updated defaults from examples
This commit is contained in:
@@ -19,7 +19,12 @@ class Router {
|
||||
}
|
||||
|
||||
private function loadRoutes() {
|
||||
require_once( BASEPATH . '/App/routes.php');
|
||||
// Check if Path exists
|
||||
if (file_exists(BASEPATH . '/App/routes.php')) {
|
||||
require_once( BASEPATH . '/App/routes.php');
|
||||
} else {
|
||||
require_once(FRAMEWORKPATH . '/defaults/App/routes.php');
|
||||
}
|
||||
return $routes;
|
||||
}
|
||||
|
||||
@@ -104,9 +109,13 @@ class Router {
|
||||
if (file_exists($cp)) {
|
||||
return $cp;
|
||||
} else {
|
||||
return BASEPATH . '/App/controllers/404.php';
|
||||
//Check if 404 exits
|
||||
if (file_exists(BASEPATH . '/App/controllers/404.php')) {
|
||||
return BASEPATH . '/App/controllers/404.php';
|
||||
} else {
|
||||
return FRAMEWORKPATH . '/defaults/App/controllers/404.php';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function debug() {
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
<?php
|
||||
define('FRAMEWORKPATH', BASEPATH . '/vendor/4lt/novaconium');
|
||||
|
||||
require_once(BASEPATH . '/vendor/autoload.php');
|
||||
require_once(BASEPATH . '/App/config.php');
|
||||
|
||||
//Check if config file exists
|
||||
if (file_exists(BASEPATH . '/App/config.php')) {
|
||||
require_once(BASEPATH . '/App/config.php');
|
||||
} else {
|
||||
require_once(FRAMEWORKPATH . '/defaults/App/config.php');
|
||||
}
|
||||
|
||||
// Creates twig and the view() function
|
||||
require_once(BASEPATH . '/vendor/4lt/novaconium/src/twig.php');
|
||||
require_once(FRAMEWORKPATH . '/src/twig.php');
|
||||
|
||||
// Start a Session
|
||||
require_once(BASEPATH . '/vendor/4lt/novaconium/src/Session.php');
|
||||
require_once(FRAMEWORKPATH . '/src/Session.php');
|
||||
$session = new Session();
|
||||
|
||||
// Load Database Class
|
||||
require_once(BASEPATH . '/vendor/4lt/novaconium/src/Database.php');
|
||||
require_once(FRAMEWORKPATH . '/src/Database.php');
|
||||
$db = new Database($config['database']);
|
||||
|
||||
// Load a controller
|
||||
require_once(BASEPATH . '/vendor/4lt/novaconium/src/Router.php');
|
||||
require_once(FRAMEWORKPATH . '/src/Router.php');
|
||||
$router = new Router();
|
||||
//$router->debug();
|
||||
require_once($router->controllerPath);
|
||||
|
||||
Reference in New Issue
Block a user