diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-04-14 22:08:39 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-04-14 22:08:39 -0400 |
commit | cc9f3e69c61147811d2dba0828c434ed42c3c372 (patch) | |
tree | 44f6b75857b270f19efcdfdd6b2d30d60bd23088 /app/common.php | |
parent | f4e8eb176f19b31176bd3a5f9284b54e9ea6fb17 (diff) |
Added new constant DATA_DIR
Diffstat (limited to 'app/common.php')
-rw-r--r-- | app/common.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/common.php b/app/common.php index c9907ce1..aed07a50 100644 --- a/app/common.php +++ b/app/common.php @@ -14,12 +14,16 @@ if (getenv('DATABASE_URL')) { define('DB_NAME', ltrim($dbopts["path"], '/')); } -if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'config.php')) { - require __DIR__.DIRECTORY_SEPARATOR.'config.php'; +$config_file = implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'config.php')); + +if (file_exists($config_file)) { + require $config_file; } -if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'config.php')) { - require __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'config.php'; +$config_file = implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'data', 'config.php')); + +if (file_exists($config_file)) { + require $config_file; } require __DIR__.'/constants.php'; |