From e8b3e8498d9842296a905fdaad8c0c32e31bceb4 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 24 Feb 2013 12:54:05 +0100 Subject: [PATCH 1/3] [ticket/7262] Backport set_config() and set_config_count() docs from develop. PHPBB3-7262 --- phpBB/includes/functions.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 571c863839..04b69f8c69 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -137,7 +137,14 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false) } /** -* Set config value. Creates missing config entry. +* Sets a configuration option's value. +* +* @param string $config_name The configuration option's name +* @param string $config_value New configuration value +* @param bool $is_dynamic Whether this variable should be cached or if it +* changes too frequently to be efficiently cached. +* +* @return null */ function set_config($config_name, $config_value, $is_dynamic = false) { @@ -166,7 +173,14 @@ function set_config($config_name, $config_value, $is_dynamic = false) } /** -* Set dynamic config value with arithmetic operation. +* Increments an integer config value directly in the database. +* +* @param string $config_name The configuration option's name +* @param int $increment Amount to increment by +* @param bool $is_dynamic Whether this variable should be cached or if it +* changes too frequently to be efficiently cached. +* +* @return null */ function set_config_count($config_name, $increment, $is_dynamic = false) { From a9037a68c177d396b2ed4b9bfcaad64536a01aaa Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 24 Feb 2013 13:03:48 +0100 Subject: [PATCH 2/3] [ticket/7262] Add $is_dynamic example to set_config() and set_config_count(). The logic is the other way around here in comparison to develop's phpbb_config_db class, so add examples to make things more clear. PHPBB3-7262 --- phpBB/includes/functions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 04b69f8c69..2ca7d7f898 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -141,8 +141,9 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false) * * @param string $config_name The configuration option's name * @param string $config_value New configuration value -* @param bool $is_dynamic Whether this variable should be cached or if it -* changes too frequently to be efficiently cached. +* @param bool $is_dynamic Whether this variable should be cached (false) or +* if it changes too frequently (true) to be +* efficiently cached. * * @return null */ @@ -177,8 +178,9 @@ function set_config($config_name, $config_value, $is_dynamic = false) * * @param string $config_name The configuration option's name * @param int $increment Amount to increment by -* @param bool $is_dynamic Whether this variable should be cached or if it -* changes too frequently to be efficiently cached. +* @param bool $is_dynamic Whether this variable should be cached (false) or +* if it changes too frequently (true) to be +* efficiently cached. * * @return null */ From 6bf64d5620b1b9f165a65b50042c391a29ef151c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 24 Feb 2013 13:37:52 +0100 Subject: [PATCH 3/3] [ticket/7262] Add note about set_config() not updating is_dynamic. PHPBB3-7262 --- phpBB/includes/functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 2ca7d7f898..ccd2d3147c 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -139,6 +139,9 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false) /** * Sets a configuration option's value. * +* Please note that this function does not update the is_dynamic value for +* an already existing config option. +* * @param string $config_name The configuration option's name * @param string $config_value New configuration value * @param bool $is_dynamic Whether this variable should be cached (false) or