Create new ROOT_CORE constant.
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
<?php
|
||||
require_once('config.php');
|
||||
|
||||
define('ROOT_CORE', ROOT_DIR.'/src');
|
||||
|
||||
// Incluir clases
|
||||
spl_autoload_register(function ($className) {
|
||||
$fp = str_replace('\\','/',$className);
|
||||
$name = basename($fp);
|
||||
$dir = dirname($fp);
|
||||
$file = ROOT_DIR.'/src/'.$dir.'/'.$name.'.php';
|
||||
$file = ROOT_CORE.'/'.$dir.'/'.$name.'.php';
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
return;
|
||||
@ -14,7 +16,7 @@ spl_autoload_register(function ($className) {
|
||||
});
|
||||
|
||||
// Incluir routers
|
||||
$routers = glob(ROOT_DIR.'/src/Routers/*.php');
|
||||
$routers = glob(ROOT_CORE.'/Routers/*.php');
|
||||
|
||||
foreach($routers as $file){
|
||||
require_once($file);
|
||||
|
Reference in New Issue
Block a user