varname changes

This commit is contained in:
uwetews
2015-08-23 02:03:25 +02:00
parent e2f11126eb
commit fb83a888f3

View File

@@ -39,22 +39,23 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
$components = explode('|', $source->name); $components = explode('|', $source->name);
$exists = true; $exists = true;
foreach ($components as $component) { foreach ($components as $component) {
$s = Smarty_Template_Source::load(null, $source->smarty, $component); /* @var \Smarty_Template_Source $_s */
if ($s->type == 'php') { $_s = Smarty_Template_Source::load(null, $source->smarty, $component);
throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type"); if ($_s->type == 'php') {
throw new SmartyException("Resource type {$_s->type} cannot be used with the extends resource type");
} }
$sources[$s->uid] = $s; $sources[$_s->uid] = $_s;
$uid .= $source->smarty->_realpath($s->filepath, true); $uid .= $source->smarty->_realpath($_s->filepath, true);
if ($_template) { if ($_template) {
$exists = $exists && $s->exists; $exists = $exists && $_s->exists;
} }
} }
$source->components = $sources; $source->components = $sources;
$source->filepath = $s->filepath; $source->filepath = $_s->filepath;
$source->uid = sha1($uid); $source->uid = sha1($uid);
$source->exists = $exists; $source->exists = $exists;
if ($_template) { if ($_template) {
$source->timestamp = $s->timestamp; $source->timestamp = $_s->timestamp;
} }
} }
@@ -66,10 +67,11 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
public function populateTimestamp(Smarty_Template_Source $source) public function populateTimestamp(Smarty_Template_Source $source)
{ {
$source->exists = true; $source->exists = true;
foreach ($source->components as $s) { /* @var \Smarty_Template_Source $_s */
$source->exists = $source->exists && $s->exists; foreach ($source->components as $_s) {
$source->exists = $source->exists && $_s->exists;
} }
$source->timestamp = $source->exists ? $s->getTimeStamp() : false; $source->timestamp = $source->exists ? $_s->getTimeStamp() : false;
} }
/** /**
@@ -89,9 +91,10 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
$_components = array_reverse($source->components); $_components = array_reverse($source->components);
$_content = ''; $_content = '';
foreach ($_components as $_component) { /* @var \Smarty_Template_Source $_s */
foreach ($_components as $_s) {
// read content // read content
$_content .= $_component->getContent(); $_content .= $_s->getContent();
} }
return $_content; return $_content;
} }