remove unnecessary init.php.
This commit is contained in:
parent
cca5cb26ec
commit
23704b3fb6
28
src/init.php
28
src/init.php
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
$db = new mysqli(dbhost, dbuser, dbpass, dbname);
|
||||
|
||||
if ($db->connect_errno){
|
||||
exit('No se ha podido conectar a la base de datos.');
|
||||
}
|
||||
|
||||
// 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)) {
|
||||
require_once $file;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
// Incluir routers
|
||||
$routers = glob(ROOT_DIR.'/src/Routers/*.php');
|
||||
|
||||
foreach($routers as $file){
|
||||
require_once($file);
|
||||
}
|
||||
|
||||
\Libs\Router::apply();
|
||||
?>
|
Loading…
Reference in New Issue
Block a user