duckbrain/index.php

27 lines
516 B
PHP
Raw Normal View History

2020-03-08 04:37:19 +01:00
<?php
require_once('config.php');
2024-05-10 00:36:48 +02:00
define('ROOT_CORE', ROOT_DIR.'/src');
2020-03-08 04:37:19 +01:00
// Incluir clases
spl_autoload_register(function ($className) {
$fp = str_replace('\\','/',$className);
$name = basename($fp);
$dir = dirname($fp);
2024-05-10 00:36:48 +02:00
$file = ROOT_CORE.'/'.$dir.'/'.$name.'.php';
2020-03-08 04:37:19 +01:00
if (file_exists($file)) {
2021-10-22 05:34:49 +02:00
require_once $file;
return;
2020-03-08 04:37:19 +01:00
}
});
// Incluir routers
2024-05-10 00:36:48 +02:00
$routers = glob(ROOT_CORE.'/Routers/*.php');
2020-03-08 04:37:19 +01:00
foreach($routers as $file){
2021-10-22 05:34:49 +02:00
require_once($file);
2020-03-08 04:37:19 +01:00
}
\Libs\Router::apply();
?>