Files
myaac/system/src/Server/Groups.php
slawkens fc9d6b2b91 [WIP] Initial Blacktek support - groups, vocations, items
items.toml loading through custom parser - no .toml reader that I tested can read it
2026-02-15 00:54:18 +01:00

31 lines
528 B
PHP

<?php
namespace MyAAC\Server;
use MyAAC\Cache\Cache;
class Groups
{
private static array $groups;
public function __construct() {
self::$groups = Cache::remember('groups', 10 * 60, function () {
$tomlGroups = glob(config('server_path') . 'config/groups.toml');
if (count($tomlGroups) > 0) {
$groups = new TOML\Groups();
}
else {
$groups = new XML\Groups();
}
$groups->load();
return $groups->getGroups();
});
}
public static function getGroups(): array {
return self::$groups;
}
}