Make preferences INI path NOT be configurable

refs #6567
This commit is contained in:
Alexander Klimov 2014-06-24 18:00:40 +02:00
parent 3e31ff65a4
commit f2693613d1
3 changed files with 5 additions and 15 deletions

View File

@ -151,9 +151,9 @@ abstract class ApplicationBootstrap
$configDir = '/etc/icingaweb'; $configDir = '/etc/icingaweb';
} }
} }
$this->configDir = realpath($configDir); $canonical = realpath($configDir);
if (!$this->configDir) { if ($canonical) {
$this->configDir = '/etc/icingaweb'; $this->configDir = $canonical;
} }
$this->setupAutoloader(); $this->setupAutoloader();

View File

@ -165,16 +165,6 @@ class Config extends Zend_Config
*/ */
public static function resolvePath($path) public static function resolvePath($path)
{ {
if (Platform::isWindows()) { return self::$configDir . DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR);
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;
} }
} }

View File

@ -132,7 +132,7 @@ abstract class PreferencesStore
} }
if ($type === 'Ini') { if ($type === 'Ini') {
$config->location = $config->config_path; $config->location = IcingaConfig::resolvePath('preferences');
} elseif ($type === 'Db') { } elseif ($type === 'Db') {
$config->connection = new DbConnection(ResourceFactory::getResourceConfig($config->resource)); $config->connection = new DbConnection(ResourceFactory::getResourceConfig($config->resource));
} }