Files
smarty/tests/UnitTests/CacheResourceTests/PDO/cacheresource.pdotest.php

23 lines
522 B
PHP
Raw Normal View History

<?php
2022-12-22 21:23:22 +01:00
use Smarty\Template\Cached;
require_once __DIR__ . '/../../__shared/cacheresources/cacheresource.pdo.php';
class Smarty_CacheResource_Pdotest extends Smarty_CacheResource_Pdo
{
public $lockTime = 0;
2023-01-02 00:49:38 +01: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);
}
}