diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-01-10 01:30:38 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-01-10 01:30:38 -0500 |
commit | fa4892488fced6c26cb2cef7481fa0b48e7c641b (patch) | |
tree | b350e43b350ec4edf7197282a351024549434741 | |
parent | d8c7137c1a30fb56db99cb48c06f24d472dd21a4 (diff) | |
download | thedroneely.com-fa4892488fced6c26cb2cef7481fa0b48e7c641b.tar.gz thedroneely.com-fa4892488fced6c26cb2cef7481fa0b48e7c641b.tar.bz2 thedroneely.com-fa4892488fced6c26cb2cef7481fa0b48e7c641b.zip |
bootstrap/Bootstrap: Allow bootstrap to facilitate more than one entry point
-rw-r--r-- | bootstrap/Bootstrap.php | 14 | ||||
-rw-r--r-- | public/index.php | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/bootstrap/Bootstrap.php b/bootstrap/Bootstrap.php index 665bdc6..39e6c08 100644 --- a/bootstrap/Bootstrap.php +++ b/bootstrap/Bootstrap.php @@ -1,10 +1,16 @@ <?php -/* composer autoloader */ -require '../vendor/autoload.php'; +/* composer autoload */ +require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/vendor/autoload.php';; /* source config file */ -$config = include '../AppConfig.php'; +$config = include $_SERVER['DOCUMENT_ROOT'] . '/..' . '/AppConfig.php';; -/* database query setup */ +/* connect database */ $contact['database'] = new QueryBuilder(Connection::make($config['database'])); + +/* create new router */ +$router = new Router; + +/* create navigator */ +$navigation = new Navigation(); diff --git a/public/index.php b/public/index.php index 8d94a89..fc39768 100644 --- a/public/index.php +++ b/public/index.php @@ -1,14 +1,8 @@ <?php -/* require core files */ +/* start application */ require '../bootstrap/Bootstrap.php'; -/* create new router */ -$router = new Router; - -/* instantiate navigator functions */ -$navigation = new Navigation(); - -/* direct routes as defined */ -require Router::load('../app/Routes.php') +/* load routes */ +require Router::load($_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/Routes.php') ->direct(Request::uri(), Request::method()); |