mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/template-engine] Fix recompilation logic.
Do not change $recompile from true to false - any recompilation condition alone is sufficient to force recompilation. Also uncomment the nonexistent file test which passes with this fix. PHPBB3-9726
This commit is contained in:
parent
4dfe4c7f13
commit
203187a841
2 changed files with 14 additions and 11 deletions
|
@ -343,6 +343,8 @@ class phpbb_template
|
||||||
$recompile = false;
|
$recompile = false;
|
||||||
$recompile = (!file_exists($filename) || @filesize($filename) === 0 || ($config['load_tplcompile'] && @filemtime($filename) < @filemtime($this->files[$handle]))) ? true : false;
|
$recompile = (!file_exists($filename) || @filesize($filename) === 0 || ($config['load_tplcompile'] && @filemtime($filename) < @filemtime($this->files[$handle]))) ? true : false;
|
||||||
|
|
||||||
|
if (!$recompile)
|
||||||
|
{
|
||||||
if (defined('DEBUG_EXTRA'))
|
if (defined('DEBUG_EXTRA'))
|
||||||
{
|
{
|
||||||
$recompile = true;
|
$recompile = true;
|
||||||
|
@ -357,6 +359,7 @@ class phpbb_template
|
||||||
}
|
}
|
||||||
$recompile = (@filemtime($filename) < @filemtime($this->files[$handle])) ? true : false;
|
$recompile = (@filemtime($filename) < @filemtime($this->files[$handle])) ? true : false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Recompile page if the original template is newer, otherwise load the compiled version
|
// Recompile page if the original template is newer, otherwise load the compiled version
|
||||||
if (!$recompile)
|
if (!$recompile)
|
||||||
|
|
|
@ -267,7 +267,7 @@ class phpbb_template_template_test extends phpbb_test_case
|
||||||
$this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist');
|
$this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist');
|
||||||
|
|
||||||
$expecting = sprintf('template->_tpl_load_file(): File %s does not exist or is empty', realpath($this->template_path . '/../') . '/templates/' . $filename);
|
$expecting = sprintf('template->_tpl_load_file(): File %s does not exist or is empty', realpath($this->template_path . '/../') . '/templates/' . $filename);
|
||||||
// $this->setExpectedTriggerError(E_USER_ERROR, $expecting);
|
$this->setExpectedTriggerError(E_USER_ERROR, $expecting);
|
||||||
|
|
||||||
$this->display('test');
|
$this->display('test');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue