mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
- added test that $_SERVER['SCRIPT_NAME'] does exist in Smarty.class.php
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
01/25/2010
|
||||
- bugfix cache resource was not loaded when caching was globally off but enabled at a template object
|
||||
- added test that $_SERVER['SCRIPT_NAME'] does exist in Smarty.class.php
|
||||
|
||||
01/22/2010
|
||||
- new method $smarty->createData([$parent]) for creating a data object (required for bugfixes below)
|
||||
|
@@ -267,8 +267,10 @@ class Smarty extends Smarty_Internal_Data {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($_SERVER['SCRIPT_NAME'])) {
|
||||
$this->assign_global('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class destructor
|
||||
@@ -354,8 +356,7 @@ class Smarty extends Smarty_Internal_Data {
|
||||
* @param object $parent next higher level of Smarty variables
|
||||
* @returns object data object
|
||||
*/
|
||||
public function createData($parent = null)
|
||||
{
|
||||
public function createData($parent = null) {
|
||||
return new Smarty_Data($parent, $this);
|
||||
}
|
||||
|
||||
@@ -368,8 +369,7 @@ class Smarty extends Smarty_Internal_Data {
|
||||
* @param mixed $compile_id compile id to be used with this template
|
||||
* @returns object template object
|
||||
*/
|
||||
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
|
||||
{
|
||||
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null) {
|
||||
if (is_object($cache_id) || is_array($cache_id)) {
|
||||
$parent = $cache_id;
|
||||
$cache_id = null;
|
||||
@@ -377,7 +377,8 @@ class Smarty extends Smarty_Internal_Data {
|
||||
if (is_array($parent)) {
|
||||
$data = $parent;
|
||||
$parent = null;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data = null;
|
||||
}
|
||||
if (!is_object($template)) {
|
||||
@@ -387,11 +388,13 @@ class Smarty extends Smarty_Internal_Data {
|
||||
if (isset($this->template_objects[$_templateId]) && $this->caching) {
|
||||
// return cached template object
|
||||
$tpl = $this->template_objects[$_templateId];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// create new template object
|
||||
$tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// just return a copy of template class
|
||||
$tpl = $template;
|
||||
}
|
||||
|
Reference in New Issue
Block a user