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

Breadcrumb

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

function Store::isLocked

Overrides StoreInterface::isLocked

File

vendor/symfony/http-kernel/HttpCache/Store.php, line 114

Class

Store
Store implements all the logic for storing cache metadata (Request and Response headers).

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function isLocked(Request $request) : bool {
    $key = $this->getCacheKey($request);
    if (isset($this->locks[$key])) {
        return true;
        // shortcut if lock held by this process
    }
    if (!is_file($path = $this->getPath($key))) {
        return false;
    }
    $h = fopen($path, 'r');
    flock($h, \LOCK_EX | \LOCK_NB, $wouldBlock);
    flock($h, \LOCK_UN);
    // release the lock we just acquired
    fclose($h);
    return (bool) $wouldBlock;
}

API Navigation

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