From 828eaecf6ab4f6c013a7955bf6af2a81c049e42f Mon Sep 17 00:00:00 2001 From: Nathan Guse <nathaniel.guse@gmail.com> Date: Mon, 30 Jul 2012 15:24:31 -0500 Subject: [ticket/10875] Changes to Cache Driver caused method_exists checks to fail SQL Cache and other functions using the check method_exists($cache, failed because of the changes to the cache system. method_exists($cache has been changed to method_exists($cache->get_driver() PHPBB3-10875 --- phpBB/includes/db/mssql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/db/mssql.php') diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index fb044b492f..4fad3f2297 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -144,7 +144,7 @@ class dbal_mssql extends dbal $this->sql_report('start', $query); } - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl && method_exists($cache->get_driver(), 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -159,7 +159,7 @@ class dbal_mssql extends dbal $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache, 'sql_save')) + if ($cache_ttl && method_exists($cache->get_driver(), 'sql_save')) { $this->open_queries[(int) $this->query_result] = $this->query_result; $cache->sql_save($query, $this->query_result, $cache_ttl); -- cgit v1.2.1 From edcac438df164764c84ca9fb7a7f751bf76d5c34 Mon Sep 17 00:00:00 2001 From: Nathan Guse <nathaniel.guse@gmail.com> Date: Mon, 30 Jul 2012 15:57:51 -0500 Subject: [ticket/10875] method_exists check is not required, interface declares them The changes to the cache drivers added an interface, which requires many cache functions exist. For these, we can remove the method_exists() check PHPBB3-10875 --- phpBB/includes/db/mssql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/db/mssql.php') diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 4fad3f2297..e40510835a 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -144,7 +144,7 @@ class dbal_mssql extends dbal $this->sql_report('start', $query); } - $this->query_result = ($cache_ttl && method_exists($cache->get_driver(), 'sql_load')) ? $cache->sql_load($query) : false; + $this->query_result = ($cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); if ($this->query_result === false) @@ -159,7 +159,7 @@ class dbal_mssql extends dbal $this->sql_report('stop', $query); } - if ($cache_ttl && method_exists($cache->get_driver(), 'sql_save')) + if ($cache_ttl) { $this->open_queries[(int) $this->query_result] = $this->query_result; $cache->sql_save($query, $this->query_result, $cache_ttl); -- cgit v1.2.1