Fixes config code
parent
13f2ca4fe4
commit
ed1c305358
|
@ -4,6 +4,11 @@ namespace App\Core;
|
|||
|
||||
class ConfigLoader
|
||||
{
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private static $configPath = null;
|
||||
|
||||
/**
|
||||
* Load configuration array from a set of possible file locations.
|
||||
*
|
||||
|
@ -22,6 +27,15 @@ class ConfigLoader
|
|||
if (!$configFile) {
|
||||
die('Config file not found');
|
||||
}
|
||||
self::$configPath = $configFile;
|
||||
return require $configFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public static function getConfigPath(): ?string
|
||||
{
|
||||
return self::$configPath;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,6 +121,9 @@ $config = ConfigLoader::loadConfig([
|
|||
'/srv/jilo-web/jilo-web.conf.php',
|
||||
'/opt/jilo-web/jilo-web.conf.php',
|
||||
]);
|
||||
// Expose config file path for pages
|
||||
$config_file = ConfigLoader::getConfigPath();
|
||||
$localConfigPath = str_replace(__DIR__ . '/..', '', $config_file);
|
||||
|
||||
$app_root = $config['folder'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue