Files
smarty/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.pdotest.php
2022-12-22 21:23:22 +01:00

23 lines
502 B
PHP

<?php
use Smarty\Template\Cached;
require_once SMARTY_DIR . '../demo/plugins/cacheresource.pdo.php';
class Smarty_CacheResource_Pdotest extends Smarty_CacheResource_Pdo
{
public $lockTime = 0;
public function hasLock(Smarty $smarty, Cached $cached)
{
if ($this->lockTime) {
$this->lockTime--;
if (!$this->lockTime) {
$this->releaseLock($smarty, $cached);
}
}
return parent::hasLock($smarty, $cached);
}
}