Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FlockStore.php

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\Store

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal