Files

33 lines
767 B
PHP
Raw Permalink Normal View History

<?php
2023-08-08 00:04:14 +02:00
use Smarty\Template;
use Smarty\Template\Cached;
require_once __DIR__ . '/../../../__shared/cacheresources/cacheresource.memcache.php';
class Smarty_CacheResource_Memcachetest extends Smarty_CacheResource_Memcache
{
public $lockTime = 0;
2023-08-08 00:04:14 +02:00
public function hasLock(\Smarty\Smarty $smarty, Cached $cached)
{
if ($this->lockTime) {
$this->lockTime--;
if (!$this->lockTime) {
$this->releaseLock($smarty, $cached);
}
}
return parent::hasLock($smarty, $cached);
}
2023-08-08 00:04:14 +02:00
public function get(Template $_template)
{
$this->contents = array();
$this->timestamps = array();
$t = $this->getContent($_template);
return $t ? $t : null;
}
}