diff options
author | Andreas Fischer <bantu@phpbb.com> | 2015-02-02 20:07:46 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2015-02-02 20:07:46 +0100 |
commit | df77174a2b2a8f9e86ee8f992556dd4820484be3 (patch) | |
tree | 3a83dabddd37c465de62e60bd2bcecf3c8a29474 /phpBB/includes/functions_compatibility.php | |
parent | 6e2838a4cabc6e7874ff1a72af2d3eb4f5361428 (diff) | |
parent | 79d4ff553844fa80be4da9286239f62a45489072 (diff) | |
download | forums-df77174a2b2a8f9e86ee8f992556dd4820484be3.tar forums-df77174a2b2a8f9e86ee8f992556dd4820484be3.tar.gz forums-df77174a2b2a8f9e86ee8f992556dd4820484be3.tar.bz2 forums-df77174a2b2a8f9e86ee8f992556dd4820484be3.tar.xz forums-df77174a2b2a8f9e86ee8f992556dd4820484be3.zip |
Merge pull request #3280 from MGaetan89/ticket/13494
[ticket/13494] Change set_config() calls with $config->set()
* MGaetan89/ticket/13494:
[ticket/13494] Update calls to `set_config()`
Diffstat (limited to 'phpBB/includes/functions_compatibility.php')
-rw-r--r-- | phpBB/includes/functions_compatibility.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 014f5d40e3..552eaaeb80 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -264,3 +264,36 @@ function add_log() return $phpbb_log->add($mode, $user_id, $user_ip, $log_operation, time(), $additional_data); } + +/** + * 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 + * 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($config_name, $config_value, $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->set($config_name, $config_value, !$is_dynamic); +} |