Files

27 lines
601 B
PHP
Raw Permalink Normal View History

<?php
2023-08-08 00:04:14 +02:00
use Smarty\Exception;
use Smarty\Template\Cached;
require_once __DIR__ . '/../cacheresources/cacheresource.mysql.php';
class Smarty_CacheResource_Mysqltest extends Smarty_CacheResource_Mysql
{
public $lockTime = 0;
2023-08-08 00:04:14 +02:00
protected function db(): PDO {
return PHPUnit_Smarty::$pdo;
}
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);
}
}