diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php index a93e6ce08c..9dfc28b3f6 100644 --- a/phpBB/phpbb/cache/driver/base.php +++ b/phpBB/phpbb/cache/driver/base.php @@ -31,32 +31,32 @@ abstract class base implements \phpbb\cache\driver\driver_interface try { $iterator = new \DirectoryIterator($this->cache_dir); + + foreach ($iterator as $fileInfo) + { + if ($fileInfo->isDot()) + { + continue; + } + $filename = $fileInfo->getFilename(); + if ($fileInfo->isDir()) + { + $this->remove_dir($fileInfo->getPathname()); + } + else if (strpos($filename, 'container_') === 0 || + strpos($filename, 'autoload_') === 0 || + strpos($filename, 'url_matcher') === 0 || + strpos($filename, 'url_generator') === 0 || + strpos($filename, 'sql_') === 0 || + strpos($filename, 'data_') === 0) + { + $this->remove_file($fileInfo->getPathname()); + } + } } catch (\Exception $e) { - return; - } - - foreach ($iterator as $fileInfo) - { - if ($fileInfo->isDot()) - { - continue; - } - $filename = $fileInfo->getFilename(); - if ($fileInfo->isDir()) - { - $this->remove_dir($fileInfo->getPathname()); - } - else if (strpos($filename, 'container_') === 0 || - strpos($filename, 'autoload_') === 0 || - strpos($filename, 'url_matcher') === 0 || - strpos($filename, 'url_generator') === 0 || - strpos($filename, 'sql_') === 0 || - strpos($filename, 'data_') === 0) - { - $this->remove_file($fileInfo->getPathname()); - } + // Do not return, to purge vars cached in memory } unset($this->vars); diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index 4ccd0607cd..feee588860 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -50,18 +50,7 @@ abstract class memory extends \phpbb\cache\driver\base */ function purge() { - unset($this->vars); - unset($this->sql_rowset); - unset($this->sql_row_pointer); - - if (function_exists('opcache_reset')) - { - @opcache_reset(); - } - - $this->vars = []; - $this->sql_rowset = []; - $this->sql_row_pointer = []; + parent::purge(); $this->is_modified = true; diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index f291751575..2094205bfe 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -74,10 +74,10 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case ->will($this->returnValue(true)); $this->request->expects($this->exactly(2)) ->method('server') - ->willReturnCallback(fn(string $arg) => match(true) { - $arg === 'PHP_AUTH_USER' => 'foobar', - $arg === 'PHP_AUTH_PW' => 'example', - }); + ->willReturnMap([ + ['PHP_AUTH_USER', 'foobar'], + ['PHP_AUTH_PW', 'example'] + ]); $expected = array( 'status' => LOGIN_SUCCESS, diff --git a/tests/dbal/connect_test.php b/tests/dbal/connect_test.php index d1ec75470a..7220a60bf7 100644 --- a/tests/dbal/connect_test.php +++ b/tests/dbal/connect_test.php @@ -35,7 +35,7 @@ class phpbb_dbal_connect_test extends phpbb_database_test_case if ($db->get_sql_layer() === 'mysqli') { - $this->setExpectedTriggerError(E_WARNING); + $this->setExpectedTriggerError(E_WARNING); } else if ($db->get_sql_layer() !== 'sqlite3') { diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index bcc299fae5..30dcaa89c7 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -255,7 +255,6 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $form = $crawler->selectButton('Submit')->form(); $form['minimum_stability']->select('dev'); - $form['enable_packagist']->select('1'); $form['repositories'] = 'https://satis.phpbb.com/'; $crawler = self::submit($form); $this->assertContainsLang('CONFIG_UPDATED', $crawler->filter('div[class="successbox"] > p')->text()); diff --git a/tests/text_processing/message_parser_test.php b/tests/text_processing/message_parser_test.php index ca301b9b3e..35dcb4b566 100644 --- a/tests/text_processing/message_parser_test.php +++ b/tests/text_processing/message_parser_test.php @@ -61,7 +61,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case $user->style = array('style_id' => 1); $user->expects($this->any()) - -> method('__get')->with('lang')->willReturn([ + ->method('__get')->with('lang')->willReturn([ 'NO_POLL_TITLE' => 'You have to enter a poll title.', 'POLL_TITLE_TOO_LONG' => 'The poll title must contain fewer than 100 characters.', 'POLL_TITLE_COMP_TOO_LONG' => 'The parsed size of your poll title is too large, consider removing BBCodes or smilies.',