mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Revert "Make preferences INI path NOT be configurable"
This reverts commit f2693613d1b9e169b3f7249fd71800fb5981a9db.
This commit is contained in:
parent
fdf74c5e18
commit
ebca81b040
@ -151,9 +151,9 @@ abstract class ApplicationBootstrap
|
|||||||
$configDir = '/etc/icingaweb';
|
$configDir = '/etc/icingaweb';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$canonical = realpath($configDir);
|
$this->configDir = realpath($configDir);
|
||||||
if ($canonical) {
|
if (!$this->configDir) {
|
||||||
$this->configDir = $canonical;
|
$this->configDir = '/etc/icingaweb';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setupAutoloader();
|
$this->setupAutoloader();
|
||||||
|
@ -165,6 +165,16 @@ class Config extends Zend_Config
|
|||||||
*/
|
*/
|
||||||
public static function resolvePath($path)
|
public static function resolvePath($path)
|
||||||
{
|
{
|
||||||
return self::$configDir . DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR);
|
if (Platform::isWindows()) {
|
||||||
|
throw new ProgrammingError('Windows support has not yet been implemented');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strpos(dirname($path), DIRECTORY_SEPARATOR) === 0) {
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
$path = self::$configDir . DIRECTORY_SEPARATOR . $path;
|
||||||
|
$canonical = realpath($path);
|
||||||
|
return ($canonical === false) ? $path : $canonical;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ abstract class PreferencesStore
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($type === 'Ini') {
|
if ($type === 'Ini') {
|
||||||
$config->location = IcingaConfig::resolvePath('preferences');
|
$config->location = $config->config_path;
|
||||||
} elseif ($type === 'Db') {
|
} elseif ($type === 'Db') {
|
||||||
$config->connection = new DbConnection(ResourceFactory::getResourceConfig($config->resource));
|
$config->connection = new DbConnection(ResourceFactory::getResourceConfig($config->resource));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user