mirror of
https://github.com/slawkens/myaac.git
synced 2026-03-16 16:03:31 +01:00
[WIP] Initial Blacktek support - groups, vocations, items
items.toml loading through custom parser - no .toml reader that I tested can read it
This commit is contained in:
30
system/src/Server/Groups.php
Normal file
30
system/src/Server/Groups.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user