aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_compatibility.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2015-02-03 18:13:20 +0100
committerAndreas Fischer <bantu@phpbb.com>2015-02-03 18:13:20 +0100
commit284aa8c496d658c196a0dfa3c90657415ee4c2ee (patch)
tree6ea6f60315c6ac672b194ea0e22288d77d7f9815 /phpBB/includes/functions_compatibility.php
parent3fb6d5b838c33dc31563de7febbe827647f85abc (diff)
parenta633f3484c63fe4bd70df548b3ae4bd569bdef46 (diff)
downloadforums-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.php27
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);
+}