2020-03-08 04:37:19 +01:00
|
|
|
<?php
|
|
|
|
require_once('config.php');
|
|
|
|
|
|
|
|
// Incluir clases
|
|
|
|
spl_autoload_register(function ($className) {
|
|
|
|
$fp = str_replace('\\','/',$className);
|
|
|
|
$name = basename($fp);
|
|
|
|
$dir = dirname($fp);
|
|
|
|
$file = ROOT_DIR.'/src/'.$dir.'/'.$name.'.php';
|
|
|
|
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
|
|
|
|
$routers = glob(ROOT_DIR.'/src/Routers/*.php');
|
|
|
|
|
|
|
|
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();
|
|
|
|
?>
|