Skip to content

Commit

Permalink
update file
Browse files Browse the repository at this point in the history
  • Loading branch information
juancristobalgd1 committed Feb 29, 2024
1 parent 366e5b1 commit e7bfdc8
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,30 @@ 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])) {
include $classMap[$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;
}
}
Expand Down

0 comments on commit e7bfdc8

Please sign in to comment.