Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Cache;
4
 
5
use Illuminate\Redis\Connections\PhpRedisConnection;
6
 
7
class PhpRedisLock extends RedisLock
8
{
9
    /**
10
     * Create a new phpredis lock instance.
11
     *
12
     * @param  \Illuminate\Redis\Connections\PhpRedisConnection  $redis
13
     * @param  string  $name
14
     * @param  int  $seconds
15
     * @param  string|null  $owner
16
     * @return void
17
     */
18
    public function __construct(PhpRedisConnection $redis, string $name, int $seconds, ?string $owner = null)
19
    {
20
        parent::__construct($redis, $name, $seconds, $owner);
21
    }
22
 
23
    /**
24
     * {@inheritDoc}
25
     */
26
    public function release()
27
    {
28
        return (bool) $this->redis->eval(
29
            LuaScripts::releaseLock(),
30
            1,
31
            $this->name,
32
            ...$this->redis->pack([$this->owner])
33
        );
34
    }
35
}