From e7bfdc80b15489d1f8946eaca2eb8a971a41d3fd Mon Sep 17 00:00:00 2001 From: Juan Cristobal Date: Fri, 1 Mar 2024 00:45:22 +0100 Subject: [PATCH] update file --- src/autoload.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/autoload.php b/src/autoload.php index 86708a8..4e9a4f6 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -4,15 +4,16 @@ function axm_autoloader(string $class) { static $classMap; $classMap ??= [ - 'Container' => AXM_PATH . DIRECTORY_SEPARATOR . 'Container.php', - 'App' => AXM_PATH . DIRECTORY_SEPARATOR . 'App.php', - 'Config' => AXM_PATH . DIRECTORY_SEPARATOR . 'Config.php', - 'Env' => AXM_PATH . DIRECTORY_SEPARATOR . 'Env.php', - 'Facade' => AXM_PATH . DIRECTORY_SEPARATOR . 'Facade.php', - 'Config' => AXM_PATH . DIRECTORY_SEPARATOR . 'Config.php', - 'Controller' => AXM_PATH . DIRECTORY_SEPARATOR . 'Controller.php', - // 'Router' => AXM_PATH . DIRECTORY_SEPARATOR . 'Router.php', - 'BaseModel' => AXM_PATH . DIRECTORY_SEPARATOR . 'BaseModel.php', + + 'Container' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Container.php', + 'App' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'App.php', + 'Config' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Config.php', + 'Env' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Env.php', + 'Facade' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Facade.php', + 'Controller' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Controller.php', + 'BaseModel' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'BaseModel.php', + // 'Config' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Config.php', + // 'Router' => AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Router.php', ]; if (isset($classMap[$class])) { @@ -20,13 +21,13 @@ function axm_autoloader(string $class) return; } - if (is_file(AXM_PATH . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . $class . '.php')) { - include AXM_PATH . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . $class . '.php'; + if (is_file(AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . $class . '.php')) { + include AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . $class . '.php'; return; } - if (is_file(AXM_PATH . DIRECTORY_SEPARATOR . 'libraries' . $class . DIRECTORY_SEPARATOR . $class . '.php')) { - include AXM_PATH . DIRECTORY_SEPARATOR . 'libraries' . $class . DIRECTORY_SEPARATOR . $class . '.php'; + if (is_file(AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'libraries' . $class . DIRECTORY_SEPARATOR . $class . '.php')) { + include AXM_PATH . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'libraries' . $class . DIRECTORY_SEPARATOR . $class . '.php'; return; } }