summaryrefslogtreecommitdiff
path: root/scripts/run.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2017-08-25 01:47:18 +0100
committerFbenas <philbeansburton@gmail.com>2017-08-25 01:47:18 +0100
commit903b671e7d6cc1c289be5dc7f356a9e5fb98dbf7 (patch)
tree005a8c4d9750fc4fe42667c166d000e20ecf21d2 /scripts/run.php
parentd082907cb71f568da01e1f22a2c4eab1e3ced7aa (diff)
Add config and config loader and remove requirement of trailing slashes in config values
Diffstat (limited to 'scripts/run.php')
-rw-r--r--scripts/run.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/run.php b/scripts/run.php
index 0ba999a..2995f8a 100644
--- a/scripts/run.php
+++ b/scripts/run.php
@@ -7,10 +7,20 @@ error_reporting(E_ALL);
// Pull in bootstrap
require(realpath(dirname(__FILE__) . "/../bootstrap.php"));
+
+// Load a config
+try {
+ $loader = new App\Config\Loader();
+ $config = $loader->getConfig();
+} catch (Exception $e) {
+ echo $e->getMessage() . "\n";
+ exit;
+}
+
// Set up siteroot
// TODO Don't rely on trailing slashes here
define('DIPPER_ROOT', realpath(dirname(__FILE__) . "/../") . '/');
-define('SITES_ROOT', '/home/phil/sites/');
-define('CONFIG_ROOT', '/home/phil/sites/');
+define('SITES_ROOT', $config['SITES_ROOT']);
+define('CONFIG_ROOT', $config['SITES_ROOT']);
new App\Script\Console;