function FlockStore::__construct
Parameters
string|null $lockPath the directory to store the lock, defaults to the system's temporary directory:
Throws
LockStorageException If the lock directory doesn’t exist or is not writable
File
-
vendor/
symfony/ lock/ Store/ FlockStore.php, line 40
Class
- FlockStore
- FlockStore is a PersistingStoreInterface implementation using the FileSystem flock.
Namespace
Symfony\Component\Lock\StoreCode
public function __construct(?string $lockPath = null) {
if (!is_dir($lockPath ??= sys_get_temp_dir())) {
if (false === @mkdir($lockPath, 0777, true) && !is_dir($lockPath)) {
throw new InvalidArgumentException(\sprintf('The FlockStore directory "%s" does not exists and cannot be created.', $lockPath));
}
}
elseif (!is_writable($lockPath)) {
throw new InvalidArgumentException(\sprintf('The FlockStore directory "%s" is not writable.', $lockPath));
}
$this->lockPath = $lockPath;
}