mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/11037] Eliminate global $db usage in cache drivers.
The only time $db is needed in cache drivers is to navigate the result set in sql_save. Pass it as a parameter in that function. PHPBB3-11037
This commit is contained in:
6
phpBB/includes/cache/driver/memory.php
vendored
6
phpBB/includes/cache/driver/memory.php
vendored
@@ -283,12 +283,10 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
|
||||
}
|
||||
|
||||
/**
|
||||
* Save sql query
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
function sql_save($query, $query_result, $ttl)
|
||||
function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// Remove extra spaces and tabs
|
||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||
$hash = md5($query);
|
||||
|
Reference in New Issue
Block a user