Create new ROOT_CORE constant.
This commit is contained in:
parent
f5f803dde2
commit
c65fcd27c8
@ -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);
|
||||
|
@ -36,7 +36,7 @@ class View extends Neuron {
|
||||
return;
|
||||
}
|
||||
|
||||
include(ROOT_DIR."/src/Views/$viewName.$extension");
|
||||
include(ROOT_CORE."/Views/$viewName.$extension");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user