mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 20:04:27 +02:00
- bugfix in $smarty->cache->clear() method. (do not cache template object)
This commit is contained in:
@@ -1,19 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty Internal Plugin CacheResource File
|
* Smarty Internal Plugin CacheResource File
|
||||||
*
|
*
|
||||||
* Implements the file system as resource for the HTML cache
|
* Implements the file system as resource for the HTML cache
|
||||||
* Version ussing nocache inserts
|
* Version ussing nocache inserts
|
||||||
*
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage Cacher
|
* @subpackage Cacher
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class does contain all necessary methods for the HTML cache on file system
|
* This class does contain all necessary methods for the HTML cache on file system
|
||||||
*/
|
*/
|
||||||
class Smarty_Internal_CacheResource_File {
|
class Smarty_Internal_CacheResource_File {
|
||||||
function __construct($smarty)
|
function __construct($smarty)
|
||||||
{
|
{
|
||||||
@@ -133,10 +133,12 @@ class Smarty_Internal_CacheResource_File {
|
|||||||
if (isset($resource_name)) {
|
if (isset($resource_name)) {
|
||||||
$_save_stat = $this->smarty->caching;
|
$_save_stat = $this->smarty->caching;
|
||||||
$this->smarty->caching = true;
|
$this->smarty->caching = true;
|
||||||
$tpl = $this->smarty->createTemplate($resource_name);
|
$tpl = new $this->smarty->template_class($resource_name, $this->smarty);
|
||||||
|
// remove from template cache
|
||||||
|
unset($this->smarty->template_objects[crc32($tpl->template_resource . $tpl->cache_id . $tpl->compile_id)]);
|
||||||
$this->smarty->caching = $_save_stat;
|
$this->smarty->caching = $_save_stat;
|
||||||
if ($tpl->isExisting()) {
|
if ($tpl->isExisting()) {
|
||||||
$_resourcename_parts = basename(str_replace('^','/',$tpl->getCachedFilepath()));
|
$_resourcename_parts = basename(str_replace('^', '/', $tpl->getCachedFilepath()));
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user