From 50e01d1284a58d596d775d91438c22792cc77a74 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 2 Jun 2014 12:09:16 +0200 Subject: [PATCH] Config: Rename `configPath' to `config_path' We use underscore_case notation for all configuration keys. refs #4952 --- application/forms/Config/GeneralForm.php | 4 ++-- config/config.ini.in | 2 +- library/Icinga/User/Preferences/PreferencesStore.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/forms/Config/GeneralForm.php b/application/forms/Config/GeneralForm.php index 484bda497..3da7923e8 100644 --- a/application/forms/Config/GeneralForm.php +++ b/application/forms/Config/GeneralForm.php @@ -330,7 +330,7 @@ class GeneralForm extends Form 'label' => 'User Preference Filepath', 'required' => $backend === 'ini', 'condition' => $backend === 'ini', - 'value' => $cfg->get('configPath') + 'value' => $cfg->get('config_path') ) ); @@ -432,7 +432,7 @@ class GeneralForm extends Form $cfg->preferences->type = $values['preferences_type']; if ($cfg->preferences->type === 'ini') { - $cfg->preferences->configPath = $values['preferences_ini_path']; + $cfg->preferences->config_path = $values['preferences_ini_path']; } elseif ($cfg->preferences->type === 'db') { $cfg->preferences->resource = $values['preferences_db_resource']; } diff --git a/config/config.ini.in b/config/config.ini.in index c8724ad77..537eaae2f 100644 --- a/config/config.ini.in +++ b/config/config.ini.in @@ -44,7 +44,7 @@ level = 1 [preferences] ; Use INI file storage to save preferences to a local disk type = "ini" -configPath = "@icingaweb_config_path@/preferences" +config_path = "@icingaweb_config_path@/preferences" ; Use database storage to save preferences in either a MySQL or PostgreSQL database ;type = db diff --git a/library/Icinga/User/Preferences/PreferencesStore.php b/library/Icinga/User/Preferences/PreferencesStore.php index b5ea62cc3..80b43a330 100644 --- a/library/Icinga/User/Preferences/PreferencesStore.php +++ b/library/Icinga/User/Preferences/PreferencesStore.php @@ -27,7 +27,7 @@ use Icinga\Application\Config as IcingaConfig; * $store = PreferencesStore::create( * new Zend_Config( * 'type' => 'ini', - * 'configPath' => '/path/to/preferences' + * 'config_path' => '/path/to/preferences' * ), * $user // Instance of \Icinga\User * ); @@ -132,7 +132,7 @@ abstract class PreferencesStore } if ($type === 'Ini') { - $config->location = IcingaConfig::resolvePath($config->configPath); + $config->location = IcingaConfig::resolvePath($config->config_path); } elseif ($type === 'Db') { $config->connection = new DbConnection(ResourceFactory::getResourceConfig($config->resource)); }