diff options
| author | 2015-01-07 16:09:24 +0100 | |
|---|---|---|
| committer | 2015-01-07 16:09:24 +0100 | |
| commit | 7f12058fab8a455cf33b5df614c5404f7a236d0a (patch) | |
| tree | dc42ab573b34aabfccbd4a51ba00614264b84c00 | |
| parent | 91e2d4936d71a72d0aefe9736879099283519239 (diff) | |
Add a method to change the configuration setter
See https://github.com/FreshRSS/FreshRSS/issues/730
| -rw-r--r-- | lib/Minz/Configuration.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index 5dbd55876..019b47fae 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -127,7 +127,18 @@ class Minz_Configuration { $this->data_default = self::load($this->default_filename); } - $this->configuration_setter = $configuration_setter; + $this->_configurationSetter($configuration_setter); + } + + /** + * Set a configuration setter for the current configuration. + * @param $configuration_setter the setter to call when modifying data. It + * must implement an handle($key, $value) method. + */ + public function _configurationSetter($configuration_setter) { + if (is_callable(array($configuration_setter, 'handle'))) { + $this->configuration_setter = $configuration_setter; + } } /** |
