aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-05-11 19:25:07 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-05-12 20:13:31 -0400
commit77787718196c05b98efccec668c4a9762591398f (patch)
tree4a387aacb065561cc85141ece99d28fe32f90a97
parent504acaba6b898de13d1c27dde567f1a01c0b0bd6 (diff)
downloadforums-77787718196c05b98efccec668c4a9762591398f.tar
forums-77787718196c05b98efccec668c4a9762591398f.tar.gz
forums-77787718196c05b98efccec668c4a9762591398f.tar.bz2
forums-77787718196c05b98efccec668c4a9762591398f.tar.xz
forums-77787718196c05b98efccec668c4a9762591398f.zip
[feature/template-engine] Move DEBUG_EXTRA check for $recompile up.
PHPBB3-9726
-rw-r--r--phpBB/includes/template.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index 85d378fa67..865535cfd5 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -325,24 +325,20 @@ class phpbb_template
$filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx;
$this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0;
- $recompile = (!file_exists($filename) || @filesize($filename) === 0 || ($config['load_tplcompile'] && @filemtime($filename) < @filemtime($this->files[$handle]))) ? true : false;
+ $recompile = defined('DEBUG_EXTRA') ||
+ !file_exists($filename) ||
+ @filesize($filename) === 0 ||
+ ($config['load_tplcompile'] && @filemtime($filename) < @filemtime($this->files[$handle]));
- if (!$recompile)
+ if (!$recompile && $config['load_tplcompile'])
{
- if (defined('DEBUG_EXTRA'))
- {
- $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]))
{
- // 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;
+ $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 page if the original template is newer, otherwise load the compiled version