This commit is contained in:
2024-01-29 10:39:53 +07:00
parent 545c404fdf
commit 72170f373a
143 changed files with 20188 additions and 3 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace Hura8\System;
use Hura8\Traits\ClassCacheTrait;
class ModuleManager
{
use ClassCacheTrait;
public static function getModuleRouting($module) {
$cache_key = "module-routing-".$module;
return static::getCache($cache_key, function () use ($module) {
$config_file = CONFIG_DIR . '/modules/'.$module.'/routing.php';
if (file_exists($config_file)) {
return include $config_file;
}
return null;
});
}
public static function getModuleAdmin($module) {
$cache_key = "module-admin-".$module;
return static::getCache($cache_key, function () use ($module) {
$config_file = CONFIG_DIR . '/modules/'.$module.'/admin.php';
if (file_exists($config_file)) {
return include $config_file;
}
return null;
});
}
}