1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02: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:
Oleg Pudeyev
2011-04-24 00:22:41 -04:00
parent 4dfe4c7f13
commit 203187a841
2 changed files with 14 additions and 11 deletions

View File

@@ -343,19 +343,22 @@ class phpbb_template
$recompile = false;
$recompile = (!file_exists($filename) || @filesize($filename) === 0 || ($config['load_tplcompile'] && @filemtime($filename) < @filemtime($this->files[$handle]))) ? true : false;
if (defined('DEBUG_EXTRA'))
if (!$recompile)
{
$recompile = true;
}
else if ($config['load_tplcompile'])
{
// No way around it: we need to check inheritance here
if ($user->theme['template_inherits_id'] && !file_exists($this->files[$handle]))
if (defined('DEBUG_EXTRA'))
{
$this->files[$handle] = $this->files_inherit[$handle];
$this->files_template[$handle] = $user->theme['template_inherits_id'];
$recompile = true;
}
else if ($config['load_tplcompile'])
{
// No way around it: we need to check inheritance here
if ($user->theme['template_inherits_id'] && !file_exists($this->files[$handle]))
{
$this->files[$handle] = $this->files_inherit[$handle];
$this->files_template[$handle] = $user->theme['template_inherits_id'];
}
$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