diff --git a/AvocadoEdition_Light/addon/index.php b/AvocadoEdition_Light/addons/index.php similarity index 100% rename from AvocadoEdition_Light/addon/index.php rename to AvocadoEdition_Light/addons/index.php diff --git a/AvocadoEdition_Light/common.php b/AvocadoEdition_Light/common.php index ad44242..c37ed2f 100644 --- a/AvocadoEdition_Light/common.php +++ b/AvocadoEdition_Light/common.php @@ -55,7 +55,7 @@ for ($i = 0; $i < $ext_cnt; $i++) { * @throws \Exception * @return string[] */ -function load_libs($base_dir) +function load_libs($base_dir, $load_type = "class") { $base_path = realpath($base_dir); if ($base_path === false) { @@ -73,7 +73,7 @@ function load_libs($base_dir) if ($file->isDir()) { $parent_folder_name = $file->getFilename(); - $class_file = $file->getPathname() . DIRECTORY_SEPARATOR . "{$parent_folder_name}.class.php"; + $class_file = $file->getPathname() . DIRECTORY_SEPARATOR . "{$parent_folder_name}.{$load_type}.php"; if (file_exists($class_file)) { require_once $class_file; @@ -139,7 +139,8 @@ function get_embed_file($type, $path, ...$args) include_once __DIR__ . "/classes/event/event_handler.php"; $_system = new stdClass; -$_system->classes = load_libs(__DIR__ . "/classes"); +$_system->classes = load_libs(__DIR__ . "/classes", "class"); +$_system->addons = load_libs(__DIR__ . "/addons", "addon"); // $_system->modules = load_libs(__DIR__ . "/modules", "model"); // $_system->modules = load_libs(__DIR__ . "/modules");