Searches for default config file
parent
5d240b1dd8
commit
8455a98ec5
|
@ -31,8 +31,22 @@ $allowed_urls = [
|
||||||
];
|
];
|
||||||
|
|
||||||
// cnfig file
|
// cnfig file
|
||||||
$config_file = '/home/yasen/work/code/git/lindeas-code/jilo-web/jilo-web.conf.php';
|
// possible locations, in order of preference
|
||||||
if (file_exists($config_file)) {
|
$config_file_locations = [
|
||||||
|
__DIR__ . '/../jilo-web.conf.php',
|
||||||
|
'/srv/jilo-web/jilo-web.conf.php',
|
||||||
|
'/opt/jilo-web/jilo-web.conf.php'
|
||||||
|
];
|
||||||
|
$config_file = null;
|
||||||
|
// try to find the config file
|
||||||
|
foreach ($config_file_locations as $location) {
|
||||||
|
if (file_exists($location)) {
|
||||||
|
$config_file = $location;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if found, use it
|
||||||
|
if ($config_file) {
|
||||||
require_once $config_file;
|
require_once $config_file;
|
||||||
} else {
|
} else {
|
||||||
die('Config file not found');
|
die('Config file not found');
|
||||||
|
|
Loading…
Reference in New Issue