fixes
This commit is contained in:
16
vendor/laravel/framework/src/Illuminate/Cache/FileLock.php
vendored
Normal file
16
vendor/laravel/framework/src/Illuminate/Cache/FileLock.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Cache;
|
||||
|
||||
class FileLock extends CacheLock
|
||||
{
|
||||
/**
|
||||
* Attempt to acquire the lock.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function acquire()
|
||||
{
|
||||
return $this->store->add($this->name, $this->owner, $this->seconds);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ use Illuminate\Support\InteractsWithTime;
|
||||
|
||||
class FileStore implements Store, LockProvider
|
||||
{
|
||||
use InteractsWithTime, HasCacheLock, RetrievesMultipleKeys;
|
||||
use InteractsWithTime, RetrievesMultipleKeys;
|
||||
|
||||
/**
|
||||
* The Illuminate Filesystem instance.
|
||||
@@ -200,6 +200,31 @@ class FileStore implements Store, LockProvider
|
||||
return $this->put($key, $value, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a lock instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $seconds
|
||||
* @param string|null $owner
|
||||
* @return \Illuminate\Contracts\Cache\Lock
|
||||
*/
|
||||
public function lock($name, $seconds = 0, $owner = null)
|
||||
{
|
||||
return new FileLock($this, $name, $seconds, $owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore a lock instance using the owner identifier.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $owner
|
||||
* @return \Illuminate\Contracts\Cache\Lock
|
||||
*/
|
||||
public function restoreLock($name, $owner)
|
||||
{
|
||||
return $this->lock($name, 0, $owner);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an item from the cache.
|
||||
*
|
||||
|
||||
@@ -394,7 +394,9 @@ class Repository implements ArrayAccess, CacheContract
|
||||
return $value;
|
||||
}
|
||||
|
||||
$this->put($key, $value = $callback(), value($ttl));
|
||||
$value = $callback();
|
||||
|
||||
$this->put($key, $value, value($ttl, $value));
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
}
|
||||
},
|
||||
"suggest": {
|
||||
"ext-apcu": "Required to use the APC cache driver.",
|
||||
"ext-filter": "Required to use the DynamoDb cache driver.",
|
||||
"ext-memcached": "Required to use the memcache cache driver.",
|
||||
"illuminate/database": "Required to use the database cache driver (^9.0).",
|
||||
"illuminate/filesystem": "Required to use the file cache driver (^9.0).",
|
||||
|
||||
Reference in New Issue
Block a user