From 38479cbba628ee76a92ff5f3c974cfa8e6ce9e61 Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Thu, 29 Nov 2012 16:06:43 +0100 Subject: some coding style improvements - removed some dead/unused code - fixed phpdoc - added typing on methods --- lib/plugins/config/settings/config.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/plugins/config/settings/config.class.php') diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index 8c48018d7..a30a0605b 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -369,7 +369,7 @@ if (!class_exists('setting')) { * update setting with user provided value $input * if value fails error check, save it * - * @return true if changed, false otherwise (incl. on error) + * @return boolean true if changed, false otherwise (incl. on error) */ function update($input) { if (is_null($input)) return false; @@ -426,7 +426,6 @@ if (!class_exists('setting')) { if ($fmt=='php') { // translation string needs to be improved FIXME - $tr = array("\n"=>'\n', "\r"=>'\r', "\t"=>'\t', "\\" => '\\\\', "'" => '\\\''); $tr = array("\\" => '\\\\', "'" => '\\\''); $out = '$'.$var."['".$this->_out_key()."'] = '".strtr($this->_local, $tr)."';\n"; @@ -538,7 +537,7 @@ if (!class_exists('setting_email')) { * update setting with user provided value $input * if value fails error check, save it * - * @return true if changed, false otherwise (incl. on error) + * @return boolean true if changed, false otherwise (incl. on error) */ function update($input) { if (is_null($input)) return false; @@ -574,7 +573,7 @@ if (!class_exists('setting_richemail')) { * update setting with user provided value $input * if value fails error check, save it * - * @return true if changed, false otherwise (incl. on error) + * @return boolean true if changed, false otherwise (incl. on error) */ function update($input) { if (is_null($input)) return false; -- cgit v1.2.3 From e0e514e1850d0f52a3fdeeee54712050fd0fe5c7 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 31 Jan 2013 16:28:25 +0100 Subject: touch the config on save, even if no changes were made --- lib/plugins/config/settings/config.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/plugins/config/settings/config.class.php') diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index a30a0605b..334e617dd 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -130,6 +130,15 @@ if (!class_exists('configuration')) { return true; } + /** + * Update last modified time stamp of the config file + */ + function touch_settings(){ + if ($this->locked) return false; + $file = end($this->_local_files); + return @touch($file); + } + function _read_config_group($files) { $config = array(); foreach ($files as $file) { -- cgit v1.2.3