File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/laravel/framework/src/Illuminate/Cache
Upload
[..]
ApcWrapper.php (1.4 KB)
Edit
Rename
Del
CacheLock.php (1.77 KB)
Edit
Rename
Del
Console/
Rename
Del
Events/
Rename
Del
FailoverStore.php (6.69 KB)
Edit
Rename
Del
LICENSE.md (1.05 KB)
Edit
Rename
Del
Limiters/
Rename
Del
MemcachedConnector.php (2.33 KB)
Edit
Rename
Del
MemcachedLock.php (1.4 KB)
Edit
Rename
Del
MemcachedStore.php (6.42 KB)
Edit
Rename
Del
NoLock.php (870 B)
Edit
Rename
Del
PhpRedisLock.php (809 B)
Edit
Rename
Del
RateLimiting/
Rename
Del
RedisLock.php (1.72 KB)
Edit
Rename
Del
RedisTagSet.php (3.82 KB)
Edit
Rename
Del
RedisTaggedCache.php (5.79 KB)
Edit
Rename
Del
TagSet.php (2.44 KB)
Edit
Rename
Del
TaggableStore.php (415 B)
Edit
Rename
Del
TaggedCache.php (2.82 KB)
Edit
Rename
Del
composer.json (1.5 KB)
Edit
Rename
Del
Edit: RedisLock.php
<?php namespace Illuminate\Cache; class RedisLock extends Lock { /** * The Redis factory implementation. * * @var \Illuminate\Redis\Connections\Connection */ protected $redis; /** * Create a new lock instance. * * @param \Illuminate\Redis\Connections\Connection $redis * @param string $name * @param int $seconds * @param string|null $owner */ public function __construct($redis, $name, $seconds, $owner = null) { parent::__construct($name, $seconds, $owner); $this->redis = $redis; } /** * Attempt to acquire the lock. * * @return bool */ public function acquire() { if ($this->seconds > 0) { return $this->redis->set($this->name, $this->owner, 'EX', $this->seconds, 'NX') == true; } return $this->redis->setnx($this->name, $this->owner) === 1; } /** * Release the lock. * * @return bool */ public function release() { return (bool) $this->redis->eval(LuaScripts::releaseLock(), 1, $this->name, $this->owner); } /** * Releases this lock in disregard of ownership. * * @return void */ public function forceRelease() { $this->redis->del($this->name); } /** * Returns the owner value written into the driver for this lock. * * @return string|null */ protected function getCurrentOwner() { return $this->redis->get($this->name); } /** * Get the name of the Redis connection being used to manage the lock. * * @return string */ public function getConnectionName() { return $this->redis->getName(); } }
Simpan