Added new constant DATA_DIR

This commit is contained in:
Frederic Guillot
2016-04-14 22:08:39 -04:00
parent f4e8eb176f
commit cc9f3e69c6
2 changed files with 19 additions and 12 deletions

View File

@@ -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';