[feature/template-engine] Rename $filename to $compiled_path for clarity.

PHPBB3-9726
This commit is contained in:
Oleg Pudeyev 2011-05-11 19:32:32 -04:00
parent 7778771819
commit 7638bcb560

View file

@ -322,13 +322,13 @@ class phpbb_template
// by other template class instances in between. // by other template class instances in between.
$user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id; $user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id;
$filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx; $compiled_path = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx;
$this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0; $this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0;
$recompile = defined('DEBUG_EXTRA') || $recompile = defined('DEBUG_EXTRA') ||
!file_exists($filename) || !file_exists($compiled_path) ||
@filesize($filename) === 0 || @filesize($compiled_path) === 0 ||
($config['load_tplcompile'] && @filemtime($filename) < @filemtime($this->files[$handle])); ($config['load_tplcompile'] && @filemtime($compiled_path) < @filemtime($this->files[$handle]));
if (!$recompile && $config['load_tplcompile']) if (!$recompile && $config['load_tplcompile'])
{ {
@ -338,13 +338,13 @@ class phpbb_template
$this->files[$handle] = $this->files_inherit[$handle]; $this->files[$handle] = $this->files_inherit[$handle];
$this->files_template[$handle] = $user->theme['template_inherits_id']; $this->files_template[$handle] = $user->theme['template_inherits_id'];
} }
$recompile = (@filemtime($filename) < @filemtime($this->files[$handle])) ? true : false; $recompile = (@filemtime($compiled_path) < @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)
{ {
return new phpbb_template_renderer_include($filename, $this); return new phpbb_template_renderer_include($compiled_path, $this);
} }
// Inheritance - we point to another template file for this one. // Inheritance - we point to another template file for this one.