mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-13 10:29:53 +01:00
23 lines
522 B
PHP
23 lines
522 B
PHP
<?php
|
|
|
|
use Smarty\Template\Cached;
|
|
|
|
require_once __DIR__ . '/../../__shared/cacheresources/cacheresource.pdo.php';
|
|
|
|
class Smarty_CacheResource_Pdotest extends Smarty_CacheResource_Pdo
|
|
{
|
|
public $lockTime = 0;
|
|
|
|
|
|
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);
|
|
}
|
|
}
|