From 903b671e7d6cc1c289be5dc7f356a9e5fb98dbf7 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Fri, 25 Aug 2017 01:47:18 +0100 Subject: Add config and config loader and remove requirement of trailing slashes in config values --- scripts/run.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') 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; -- cgit v1.2.3