diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-19 00:28:21 -0400 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-19 00:28:21 -0400 |
commit | 8fe75aefbbb0304f1335441465e566b572168365 (patch) | |
tree | 059a4c7981b53814eb0ff46622be233b15710512 /phpBB | |
parent | dcfab4e507a759e7b0ff68bfb5a47bd7e97bbfb1 (diff) | |
parent | 27bbfde2437302ec0b7848513eb15cb91c8e07ce (diff) | |
download | forums-8fe75aefbbb0304f1335441465e566b572168365.tar forums-8fe75aefbbb0304f1335441465e566b572168365.tar.gz forums-8fe75aefbbb0304f1335441465e566b572168365.tar.bz2 forums-8fe75aefbbb0304f1335441465e566b572168365.tar.xz forums-8fe75aefbbb0304f1335441465e566b572168365.zip |
Merge branch 'ticket/erikfrerejean/10006' into develop
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/config/config.php | 13 | ||||
-rw-r--r-- | phpBB/includes/config/db.php | 22 |
2 files changed, 35 insertions, 0 deletions
diff --git a/phpBB/includes/config/config.php b/phpBB/includes/config/config.php index 64fef28cfa..4ba05a98ec 100644 --- a/phpBB/includes/config/config.php +++ b/phpBB/includes/config/config.php @@ -104,6 +104,19 @@ class phpbb_config implements ArrayAccess, IteratorAggregate, Countable } /** + * Removes a configuration option + * + * @param String $key The configuration option's name + * @param bool $cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached + * @return void + */ + public function delete($key, $cache = true) + { + unset($this->config[$key]); + } + + /** * Sets a configuration option's value * * @param string $key The configuration option's name diff --git a/phpBB/includes/config/db.php b/phpBB/includes/config/db.php index 74fb0504ce..f98056e013 100644 --- a/phpBB/includes/config/db.php +++ b/phpBB/includes/config/db.php @@ -91,6 +91,28 @@ class phpbb_config_db extends phpbb_config } /** + * Removes a configuration option + * + * @param String $key The configuration option's name + * @param bool $cache Whether this variable should be cached or if it + * changes too frequently to be efficiently cached + * @return void + */ + public function delete($key, $cache = true) + { + $sql = 'DELETE FROM ' . $this->table . " + WHERE config_name = '" . $this->db->sql_escape($key) . "'"; + $this->db->sql_query($sql); + + unset($this->config[$key]); + + if ($cache) + { + $this->cache->destroy('config'); + } + } + + /** * Sets a configuration option's value * * @param string $key The configuration option's name |