diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2015-02-03 18:13:20 +0100 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2015-02-03 18:13:20 +0100 |
| commit | 284aa8c496d658c196a0dfa3c90657415ee4c2ee (patch) | |
| tree | 6ea6f60315c6ac672b194ea0e22288d77d7f9815 /phpBB/includes/functions_compatibility.php | |
| parent | 3fb6d5b838c33dc31563de7febbe827647f85abc (diff) | |
| parent | a633f3484c63fe4bd70df548b3ae4bd569bdef46 (diff) | |
| download | forums-284aa8c496d658c196a0dfa3c90657415ee4c2ee.tar forums-284aa8c496d658c196a0dfa3c90657415ee4c2ee.tar.gz forums-284aa8c496d658c196a0dfa3c90657415ee4c2ee.tar.bz2 forums-284aa8c496d658c196a0dfa3c90657415ee4c2ee.tar.xz forums-284aa8c496d658c196a0dfa3c90657415ee4c2ee.zip | |
Merge pull request #3281 from MGaetan89/ticket/13496
[ticket/13496] Change set_config_count() calls with $config->increment()
* MGaetan89/ticket/13496:
[ticket/13496] Update calls to `set_config_count()`
Diffstat (limited to 'phpBB/includes/functions_compatibility.php')
| -rw-r--r-- | phpBB/includes/functions_compatibility.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 552eaaeb80..2673f74a62 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -297,3 +297,30 @@ function set_config($config_name, $config_value, $is_dynamic = false, \phpbb\con $config->set($config_name, $config_value, !$is_dynamic); } + +/** + * 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 (false) or + * if it changes too frequently (true) to be + * efficiently cached. + * + * @return null + * + * @deprecated 3.1.0 (To be removed: 3.3.0) + */ +function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\config\config $set_config = null) +{ + static $config = null; + if ($set_config !== null) + { + $config = $set_config; + if (empty($config_name)) + { + return; + } + } + $config->increment($config_name, $increment, !$is_dynamic); +} |
