mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
Merge branch 'ticket/erikfrerejean/10006' into develop
This commit is contained in:
@@ -103,6 +103,19 @@ class phpbb_config implements ArrayAccess, IteratorAggregate, Countable
|
||||
return count($this->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)
|
||||
{
|
||||
unset($this->config[$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a configuration option's value
|
||||
*
|
||||
|
@@ -90,6 +90,28 @@ class phpbb_config_db extends phpbb_config
|
||||
parent::__construct($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
|
||||
*
|
||||
|
Reference in New Issue
Block a user