mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[task/config-class] Implemented a config class to replace the global array.
There is a phpbb_config class which simply holds an array and does not persist any data. It implements ArrayAccess, Countable and IteratorAggregate to allow regular use of configuration as if it was still an array. The phpbb_config_db class depends on an instance of the dbal and a cache driver. It obtains the configuration data from cache and database as necessary and persists data to the database. The functions set_config and set_config_count remain for backward compatability but they only call methods on the new config class now instead of directly manipulating the database and cache. PHPBB3-9988
This commit is contained in:
@@ -101,17 +101,8 @@ class install_update extends module
|
||||
// We do not need this any longer, unset for safety purposes
|
||||
unset($dbpasswd);
|
||||
|
||||
$config = array();
|
||||
|
||||
$sql = 'SELECT config_name, config_value
|
||||
FROM ' . CONFIG_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$config[$row['config_name']] = $row['config_value'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null);
|
||||
|
||||
// Force template recompile
|
||||
$config['load_tplcompile'] = 1;
|
||||
|
Reference in New Issue
Block a user