mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
Use require_once ; remove unnedded paramter
This commit is contained in:
@@ -75,7 +75,7 @@ if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) {
|
|||||||
*/
|
*/
|
||||||
if (!class_exists('Smarty_Autoloader', false)) {
|
if (!class_exists('Smarty_Autoloader', false)) {
|
||||||
if (!class_exists('Smarty_Internal_Data', true)) {
|
if (!class_exists('Smarty_Internal_Data', true)) {
|
||||||
require 'Autoloader.php';
|
require_once 'Autoloader.php';
|
||||||
Smarty_Autoloader::registerBC();
|
Smarty_Autoloader::registerBC();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,14 +85,13 @@ if (!class_exists('Smarty_Autoloader', false)) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!class_exists('Smarty_Internal_Data', false)) {
|
if (!class_exists('Smarty_Internal_Data', false)) {
|
||||||
require SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php';
|
require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php';
|
||||||
}
|
}
|
||||||
require SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php';
|
require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php';
|
||||||
require SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php';
|
require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php';
|
||||||
require SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php';
|
require_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php';
|
||||||
require SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php';
|
require_once SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php';
|
||||||
require SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php';
|
require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php';
|
||||||
require SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the main Smarty class
|
* This is the main Smarty class
|
||||||
@@ -1262,29 +1261,22 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
$data = null;
|
$data = null;
|
||||||
}
|
}
|
||||||
$_templateId = $this->getTemplateId($template, $cache_id, $compile_id);
|
$_templateId = $this->getTemplateId($template, $cache_id, $compile_id);
|
||||||
if ($do_clone) {
|
|
||||||
if (isset($this->template_objects[$_templateId])) {
|
if (isset($this->template_objects[$_templateId])) {
|
||||||
// return cached template object
|
if ($do_clone) {
|
||||||
$tpl = clone $this->template_objects[$_templateId];
|
$tpl = clone $this->template_objects[$_templateId];
|
||||||
$tpl->smarty = clone $tpl->smarty;
|
$tpl->smarty = clone $tpl->smarty;
|
||||||
$tpl->parent = $parent;
|
|
||||||
$tpl->tpl_vars = array();
|
|
||||||
$tpl->config_vars = array();
|
|
||||||
} else {
|
} else {
|
||||||
$tpl = new $this->template_class($template, clone $this, $parent, $cache_id, $compile_id);
|
|
||||||
$tpl->templateId = $_templateId;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (isset($this->template_objects[$_templateId])) {
|
|
||||||
// return cached template object
|
|
||||||
$tpl = $this->template_objects[$_templateId];
|
$tpl = $this->template_objects[$_templateId];
|
||||||
|
}
|
||||||
$tpl->parent = $parent;
|
$tpl->parent = $parent;
|
||||||
$tpl->tpl_vars = array();
|
$tpl->tpl_vars = array();
|
||||||
$tpl->config_vars = array();
|
$tpl->config_vars = array();
|
||||||
} else {
|
} else {
|
||||||
$tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id);
|
$tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id);
|
||||||
$tpl->templateId = $_templateId;
|
if ($do_clone) {
|
||||||
|
$tpl->smarty = clone $tpl->smarty;
|
||||||
}
|
}
|
||||||
|
$tpl->templateId = $_templateId;
|
||||||
}
|
}
|
||||||
// fill data if present
|
// fill data if present
|
||||||
if (!empty($data) && is_array($data)) {
|
if (!empty($data) && is_array($data)) {
|
||||||
|
Reference in New Issue
Block a user