mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- update realpath handling
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
- optimization of directory handling / build realpath
|
||||
- optimization of filter execution
|
||||
- move registerObject / registerClass into extension
|
||||
- update realpath handling
|
||||
|
||||
19.06.2015
|
||||
- improvement allow closures as callback at $smarty->registerFilter() https://github.com/smarty-php/smarty/issues/59
|
||||
|
@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
||||
/**
|
||||
* smarty version
|
||||
*/
|
||||
const SMARTY_VERSION = '3.1.28-dev/5';
|
||||
const SMARTY_VERSION = '3.1.28-dev/6';
|
||||
|
||||
/**
|
||||
* define variable scopes
|
||||
|
@@ -167,7 +167,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
|
||||
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
|
||||
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
|
||||
$_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
|
||||
$_dir = realpath($smarty->getCacheDir()) . '/';
|
||||
$_dir = $smarty->getCacheDir();
|
||||
if ($_dir == '/') { //We should never want to delete this!
|
||||
return 0;
|
||||
}
|
||||
|
@@ -382,13 +382,13 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil
|
||||
|
||||
// update template with original template resource of {block}
|
||||
if (trim($_attr['type'], "'") == 'file') {
|
||||
$compiler->template->template_resource = 'file:' . realpath(trim($_attr['file'], "'"));
|
||||
$compiler->template->template_resource = 'file:' . $compiler->template->smarty->_realpath(trim($_attr['file'], "'"));
|
||||
} else {
|
||||
$compiler->template->template_resource = trim($_attr['resource'], "'");
|
||||
}
|
||||
// source object
|
||||
unset ($compiler->template->source);
|
||||
$exists = $compiler->template->source->exists;
|
||||
$compiler->template->loadSource();
|
||||
|
||||
// must merge includes
|
||||
if ($_attr['nocache'] == true) {
|
||||
|
@@ -44,7 +44,7 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
|
||||
throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type");
|
||||
}
|
||||
$sources[$s->uid] = $s;
|
||||
$uid .= realpath($s->filepath);
|
||||
$uid .= $source->smarty->_realpath($s->filepath);
|
||||
if ($_template && $_template->smarty->compile_check) {
|
||||
$exists = $exists && $s->exists;
|
||||
}
|
||||
|
Reference in New Issue
Block a user