mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
__DEBUG__가 1일때만 file 캐시 사용시 eval
__DEBUG__가 0일경우 기존 include 방식을 사용
This commit is contained in:
parent
fde4ddee92
commit
4313d832fc
1 changed files with 15 additions and 8 deletions
|
|
@ -365,15 +365,22 @@ class TemplateHandler
|
||||||
ob_start();
|
ob_start();
|
||||||
if(substr($buff, 0, 7) == 'file://')
|
if(substr($buff, 0, 7) == 'file://')
|
||||||
{
|
{
|
||||||
//load cache file from disk
|
if(__DEBUG__)
|
||||||
$eval_str = FileHandler::readFile(substr($buff, 7));
|
|
||||||
$eval_str_buffed = "?>" . $eval_str;
|
|
||||||
@eval($eval_str_buffed);
|
|
||||||
$error_info = error_get_last();
|
|
||||||
//parse error
|
|
||||||
if ($error_info['type'] == 4)
|
|
||||||
{
|
{
|
||||||
throw new Exception("Error Parsing Template - {$error_info['message']} in template file {$this->file}");
|
//load cache file from disk
|
||||||
|
$eval_str = FileHandler::readFile(substr($buff, 7));
|
||||||
|
$eval_str_buffed = "?>" . $eval_str;
|
||||||
|
@eval($eval_str_buffed);
|
||||||
|
$error_info = error_get_last();
|
||||||
|
//parse error
|
||||||
|
if ($error_info['type'] == 4)
|
||||||
|
{
|
||||||
|
throw new Exception("Error Parsing Template - {$error_info['message']} in template file {$this->file}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
include(substr($buff, 7));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue