[ticket/13681] Invalidate and reset opcache where necessary

PHPBB3-13681
This commit is contained in:
Marc Alexander 2016-02-18 19:03:56 +01:00
parent 17e21d5140
commit bd12427fd4
3 changed files with 20 additions and 0 deletions

View file

@ -859,6 +859,11 @@ class queue
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
fclose($fp);
if (function_exists('opcache_invalidate'))
{
@opcache_invalidate($this->cache_file);
}
phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
}
}
@ -901,6 +906,11 @@ class queue
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
fclose($fp);
if (function_exists('opcache_invalidate'))
{
@opcache_invalidate($this->cache_file);
}
phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
$this->data = array();

View file

@ -61,6 +61,11 @@ abstract class base implements \phpbb\cache\driver\driver_interface
unset($this->sql_rowset);
unset($this->sql_row_pointer);
if (function_exists('opcache_reset'))
{
@opcache_reset();
}
$this->vars = array();
$this->sql_rowset = array();
$this->sql_row_pointer = array();

View file

@ -568,6 +568,11 @@ class file extends \phpbb\cache\driver\base
fclose($handle);
if (function_exists('opcache_invalidate'))
{
@opcache_invalidate($file);
}
if (!function_exists('phpbb_chmod'))
{
global $phpbb_root_path;