- bugfix typo in Smarty_Internal_Get_IncludePath did cause runtime overhead (Issue 74)

- improvment remove unneeded assigments (Issue 75 and 76)
This commit is contained in:
uwe.tews@googlemail.com
2012-01-20 14:47:01 +00:00
parent b38be6edaa
commit c352723ec9
4 changed files with 12 additions and 11 deletions

View File

@@ -1,5 +1,9 @@
===== trunk =====
02.01.2011
13.01.2012
- bugfix typo in Smarty_Internal_Get_IncludePath did cause runtime overhead (Issue 74)
- improvment remove unneeded assigments (Issue 75 and 76)
02.01.2012
- bugfix {block foo nocache} did not load plugins within child {block} in nocache mode (Forum Topic 20753)
29.12.2011

View File

@@ -184,7 +184,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource {
$this->cache = array();
return $this->delete($resource_name, $cache_id, $compile_id, $exp_time);
}
/**
* Check is cache is locked for this template
*
@@ -196,12 +196,12 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource {
{
$id = $cached->filepath;
$name = $cached->source->name . '.lock';
$mtime = $this->fetchTimestamp($id, $name, null, null);
if ($mtime === null) {
$this->fetch($id, $name, null, null, $content, $mtime);
}
return $mtime && time() - $mtime < $smarty->locking_timeout;
}
@@ -214,7 +214,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource {
public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
$cached->is_locked = true;
$id = $cached->filepath;
$name = $cached->source->name . '.lock';
$this->save($id, $name, null, null, $smarty->locking_timeout, '');
@@ -229,8 +229,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource {
public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
$cached->is_locked = false;
$id = $cached->filepath;
$name = $cached->source->name . '.lock';
$this->delete($name, null, null, null);
}

View File

@@ -25,7 +25,7 @@ class Smarty_Internal_Get_Include_Path {
{
static $_include_path = null;
if ($_path_array === null) {
if ($_include_path === null) {
$_include_path = explode(PATH_SEPARATOR, get_include_path());
}
@@ -34,7 +34,7 @@ class Smarty_Internal_Get_Include_Path {
return $_path . DS . $filepath;
}
}
return false;
}

View File

@@ -211,8 +211,6 @@ class Smarty_Internal_Utility {
$_resource_part_2 = str_replace('.php','.cache.php',$_resource_part_1);
$_resource_part_2_length = strlen($_resource_part_2);
} else {
$_resource_part = '';
}
$_dir = $_compile_dir;
if ($smarty->use_sub_dirs && isset($_compile_id)) {