diff options
Diffstat (limited to 'application/config')
-rw-r--r-- | application/config/ConfigJson.php | 2 | ||||
-rw-r--r-- | application/config/ConfigManager.php | 7 | ||||
-rw-r--r-- | application/config/ConfigPhp.php | 4 |
3 files changed, 5 insertions, 8 deletions
diff --git a/application/config/ConfigJson.php b/application/config/ConfigJson.php index 8c8d5610..4509357c 100644 --- a/application/config/ConfigJson.php +++ b/application/config/ConfigJson.php | |||
@@ -47,7 +47,7 @@ class ConfigJson implements ConfigIO | |||
47 | $print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0; | 47 | $print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0; |
48 | $data = self::getPhpHeaders() . json_encode($conf, $print) . self::getPhpSuffix(); | 48 | $data = self::getPhpHeaders() . json_encode($conf, $print) . self::getPhpSuffix(); |
49 | if (!file_put_contents($filepath, $data)) { | 49 | if (!file_put_contents($filepath, $data)) { |
50 | throw new \IOException( | 50 | throw new \Shaarli\Exceptions\IOException( |
51 | $filepath, | 51 | $filepath, |
52 | t('Shaarli could not create the config file. '. | 52 | t('Shaarli could not create the config file. '. |
53 | 'Please make sure Shaarli has the right to write in the folder is it installed in.') | 53 | 'Please make sure Shaarli has the right to write in the folder is it installed in.') |
diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php index 32aaea48..c95e6800 100644 --- a/application/config/ConfigManager.php +++ b/application/config/ConfigManager.php | |||
@@ -207,7 +207,7 @@ class ConfigManager | |||
207 | * | 207 | * |
208 | * @throws MissingFieldConfigException: a mandatory field has not been provided in $conf. | 208 | * @throws MissingFieldConfigException: a mandatory field has not been provided in $conf. |
209 | * @throws UnauthorizedConfigException: user is not authorize to change configuration. | 209 | * @throws UnauthorizedConfigException: user is not authorize to change configuration. |
210 | * @throws \IOException: an error occurred while writing the new config file. | 210 | * @throws \Shaarli\Exceptions\IOException: an error occurred while writing the new config file. |
211 | */ | 211 | */ |
212 | public function write($isLoggedIn) | 212 | public function write($isLoggedIn) |
213 | { | 213 | { |
@@ -221,7 +221,6 @@ class ConfigManager | |||
221 | 'general.title', | 221 | 'general.title', |
222 | 'general.header_link', | 222 | 'general.header_link', |
223 | 'privacy.default_private_links', | 223 | 'privacy.default_private_links', |
224 | 'redirector.url', | ||
225 | ); | 224 | ); |
226 | 225 | ||
227 | // Only logged in user can alter config. | 226 | // Only logged in user can alter config. |
@@ -366,6 +365,7 @@ class ConfigManager | |||
366 | $this->setEmpty('general.links_per_page', 20); | 365 | $this->setEmpty('general.links_per_page', 20); |
367 | $this->setEmpty('general.enabled_plugins', self::$DEFAULT_PLUGINS); | 366 | $this->setEmpty('general.enabled_plugins', self::$DEFAULT_PLUGINS); |
368 | $this->setEmpty('general.default_note_title', 'Note: '); | 367 | $this->setEmpty('general.default_note_title', 'Note: '); |
368 | $this->setEmpty('general.retrieve_description', false); | ||
369 | 369 | ||
370 | $this->setEmpty('updates.check_updates', false); | 370 | $this->setEmpty('updates.check_updates', false); |
371 | $this->setEmpty('updates.check_updates_branch', 'stable'); | 371 | $this->setEmpty('updates.check_updates_branch', 'stable'); |
@@ -381,9 +381,6 @@ class ConfigManager | |||
381 | // default state of the 'remember me' checkbox of the login form | 381 | // default state of the 'remember me' checkbox of the login form |
382 | $this->setEmpty('privacy.remember_user_default', true); | 382 | $this->setEmpty('privacy.remember_user_default', true); |
383 | 383 | ||
384 | $this->setEmpty('redirector.url', ''); | ||
385 | $this->setEmpty('redirector.encode_url', true); | ||
386 | |||
387 | $this->setEmpty('thumbnails.width', '125'); | 384 | $this->setEmpty('thumbnails.width', '125'); |
388 | $this->setEmpty('thumbnails.height', '90'); | 385 | $this->setEmpty('thumbnails.height', '90'); |
389 | 386 | ||
diff --git a/application/config/ConfigPhp.php b/application/config/ConfigPhp.php index 9625fe1a..cad34594 100644 --- a/application/config/ConfigPhp.php +++ b/application/config/ConfigPhp.php | |||
@@ -27,7 +27,7 @@ class ConfigPhp implements ConfigIO | |||
27 | /** | 27 | /** |
28 | * Map legacy config keys with the new ones. | 28 | * Map legacy config keys with the new ones. |
29 | * If ConfigPhp is used, getting <newkey> will actually look for <legacykey>. | 29 | * If ConfigPhp is used, getting <newkey> will actually look for <legacykey>. |
30 | * The Updater will use this array to transform keys when switching to JSON. | 30 | * The updater will use this array to transform keys when switching to JSON. |
31 | * | 31 | * |
32 | * @var array current key => legacy key. | 32 | * @var array current key => legacy key. |
33 | */ | 33 | */ |
@@ -124,7 +124,7 @@ class ConfigPhp implements ConfigIO | |||
124 | if (!file_put_contents($filepath, $configStr) | 124 | if (!file_put_contents($filepath, $configStr) |
125 | || strcmp(file_get_contents($filepath), $configStr) != 0 | 125 | || strcmp(file_get_contents($filepath), $configStr) != 0 |
126 | ) { | 126 | ) { |
127 | throw new \IOException( | 127 | throw new \Shaarli\Exceptions\IOException( |
128 | $filepath, | 128 | $filepath, |
129 | t('Shaarli could not create the config file. '. | 129 | t('Shaarli could not create the config file. '. |
130 | 'Please make sure Shaarli has the right to write in the folder is it installed in.') | 130 | 'Please make sure Shaarli has the right to write in the folder is it installed in.') |