aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2011-09-21 13:24:04 +0100
committerChris Smith <toonarmy@phpbb.com>2011-09-21 13:24:04 +0100
commit95d24e6fb7389adfeaa46e97a49b1c15b5a740ca (patch)
treefc0a8eb8f888128972b70f59e0de44b48fa5d061 /phpBB
parent9d5e9af54b2bf45baa3faa6195c2c185c08a0d4e (diff)
downloadforums-95d24e6fb7389adfeaa46e97a49b1c15b5a740ca.tar
forums-95d24e6fb7389adfeaa46e97a49b1c15b5a740ca.tar.gz
forums-95d24e6fb7389adfeaa46e97a49b1c15b5a740ca.tar.bz2
forums-95d24e6fb7389adfeaa46e97a49b1c15b5a740ca.tar.xz
forums-95d24e6fb7389adfeaa46e97a49b1c15b5a740ca.zip
[ticket/10375] Rework $source_file setting.
Only set the file if an mtime check or recompile are required. PHPBB3-10375
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/template/template.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php
index e8220b25bf..ec5fbe2829 100644
--- a/phpBB/includes/template/template.php
+++ b/phpBB/includes/template/template.php
@@ -307,13 +307,22 @@ class phpbb_template
*/
private function _tpl_load($handle)
{
- $source_file = $this->locator->get_source_file_for_handle($handle);
$output_file = $this->_compiled_file_for_handle($handle);
$recompile = defined('DEBUG_EXTRA') ||
!file_exists($output_file) ||
- @filesize($output_file) === 0 ||
- ($this->config['load_tplcompile'] && @filemtime($output_file) < @filemtime($source_file));
+ @filesize($output_file) === 0;
+
+ if ($recompile || $this->config['load_tplcompile'])
+ {
+ // Set only if a recompile or an mtime check are required.
+ $source_file = $this->locator->get_source_file_for_handle($handle);
+
+ if (!$recompile && @filemtime($output_file) < @filemtime($source_file))
+ {
+ $recompile = true;
+ }
+ }
// Recompile page if the original template is newer, otherwise load the compiled version
if (!$recompile)