summaryrefslogtreecommitdiff
path: root/tests/UnitTests/CacheResourceTests/PDO/cacheresource.pdotest.php
blob: 53ae840a84f7b634b1f7c02d0fa0207b6923b74e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?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);
    }
}