aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstrap/Bootstrap.php18
-rw-r--r--public/index.php7
2 files changed, 14 insertions, 11 deletions
diff --git a/bootstrap/Bootstrap.php b/bootstrap/Bootstrap.php
index 2754a1d..05a3597 100644
--- a/bootstrap/Bootstrap.php
+++ b/bootstrap/Bootstrap.php
@@ -1,13 +1,19 @@
<?php
-/* composer autoloader */
-require '../vendor/autoload.php';
+/* composer autoload */
+require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/vendor/autoload.php';
-/* core functions */
-require '../bootstrap/Functions.php';
+/* source functions */
+require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/bootstrap/Functions.php';
/* source config file */
-$config = include '../AppConfig.php';
+$config = include $_SERVER['DOCUMENT_ROOT'] . '/..' . '/AppConfig.php';
-/* database query setup */
+/* database connect */
$contact['database'] = new QueryBuilder(Connection::make($config['database']));
+
+/* create new router */
+$router = new Router;
+
+/* create new router */
+$navigator = new Navigator;
diff --git a/public/index.php b/public/index.php
index 1d5fad8..4f61001 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,11 +1,8 @@
<?php
-/* require core files */
+/* start application */
require '../bootstrap/Bootstrap.php';
-/* create new router */
-$router = new Router;
-
-/* direct routes as defined */
+/* load routes */
require Router::load('../bootstrap/Routes.php')
->direct(Request::uri(), Request::method());