mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Disable template compilation in external page content
This commit is contained in:
parent
a28a8e29e1
commit
0c1ee32073
1 changed files with 18 additions and 5 deletions
|
|
@ -188,6 +188,7 @@ class pageView extends page
|
||||||
$filename = $tmp_path[count($tmp_path)-1];
|
$filename = $tmp_path[count($tmp_path)-1];
|
||||||
$filepath = preg_replace('/'.$filename."$/i","",$cache_file);
|
$filepath = preg_replace('/'.$filename."$/i","",$cache_file);
|
||||||
$cache_file = FileHandler::getRealPath($cache_file);
|
$cache_file = FileHandler::getRealPath($cache_file);
|
||||||
|
$compile_template = false;
|
||||||
|
|
||||||
// Verify cache
|
// Verify cache
|
||||||
if ($caching_interval < 1 || !file_exists($cache_file) || filemtime($cache_file) + ($caching_interval * 60) <= \RX_TIME || filemtime($cache_file) < filemtime($real_target_file))
|
if ($caching_interval < 1 || !file_exists($cache_file) || filemtime($cache_file) + ($caching_interval * 60) <= \RX_TIME || filemtime($cache_file) < filemtime($real_target_file))
|
||||||
|
|
@ -209,14 +210,26 @@ class pageView extends page
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to compile
|
// Attempt to compile
|
||||||
$oTemplate = &TemplateHandler::getInstance();
|
if ($compile_template)
|
||||||
$script = $oTemplate->compileDirect($filepath, $filename);
|
{
|
||||||
|
$oTemplate = TemplateHandler::getInstance();
|
||||||
FileHandler::writeFile($cache_file, $script);
|
$script = $oTemplate->compileDirect($filepath, $filename);
|
||||||
|
FileHandler::writeFile($cache_file, $script);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return content if not compiling as template.
|
||||||
|
if (!$compile_template)
|
||||||
|
{
|
||||||
|
return file_get_contents($cache_file);
|
||||||
|
}
|
||||||
|
|
||||||
// Import Context and lang as local variables.
|
// Import Context and lang as local variables.
|
||||||
$__Context = &$GLOBALS['__Context__'];
|
$__Context = Context::getAll();
|
||||||
$__Context->tpl_path = $filepath;
|
$__Context->tpl_path = $filepath;
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue