aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Config.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-01-12 19:50:48 +0100
committerArthurHoaro <arthur@hoa.ro>2016-02-15 20:30:24 +0100
commit510377d2cb4b12d1a421e8a88bd7edb86f223451 (patch)
tree6cea29c199fc1b29ccfb78f902313019f6f9d95e /application/Config.php
parent268a2e52659964fb7d033a1bb4d1490bf8cc49bf (diff)
downloadShaarli-510377d2cb4b12d1a421e8a88bd7edb86f223451.tar.gz
Shaarli-510377d2cb4b12d1a421e8a88bd7edb86f223451.tar.zst
Shaarli-510377d2cb4b12d1a421e8a88bd7edb86f223451.zip
Introduce the Updater class which
* contains methods designed to be run once. * is able to upgrade the datastore or the configuration. * is based on methods names, stored in a text file with ';' separator (updates.txt). * begins with existing function 'mergeDeprecatedConfigFile()' (options.php).
Diffstat (limited to 'application/Config.php')
-rw-r--r--application/Config.php27
1 files changed, 0 insertions, 27 deletions
diff --git a/application/Config.php b/application/Config.php
index 9af5a535..05a59452 100644
--- a/application/Config.php
+++ b/application/Config.php
@@ -174,33 +174,6 @@ function load_plugin_parameter_values($plugins, $config)
174} 174}
175 175
176/** 176/**
177 * Milestone 0.9 - shaarli/Shaarli#41: options.php is not supported anymore.
178 * ==> if user is loggedIn, merge its content with config.php, then delete options.php.
179 *
180 * @param array $config contains all configuration fields.
181 * @param bool $isLoggedIn true if user is logged in.
182 *
183 * @return void
184 */
185function mergeDeprecatedConfig($config, $isLoggedIn)
186{
187 $config_file = $config['config']['CONFIG_FILE'];
188
189 if (is_file($config['config']['DATADIR'].'/options.php') && $isLoggedIn) {
190 include $config['config']['DATADIR'].'/options.php';
191
192 // Load GLOBALS into config
193 foreach ($GLOBALS as $key => $value) {
194 $config[$key] = $value;
195 }
196 $config['config']['CONFIG_FILE'] = $config_file;
197 writeConfig($config, $isLoggedIn);
198
199 unlink($config['config']['DATADIR'].'/options.php');
200 }
201}
202
203/**
204 * Exception used if a mandatory field is missing in given configuration. 177 * Exception used if a mandatory field is missing in given configuration.
205 */ 178 */
206class MissingFieldConfigException extends Exception 179class MissingFieldConfigException extends Exception