public function Store::lock

Locks the cache for a given Request.

Parameters

Request $request A Request instance:

Return value

Boolean|string true if the lock is acquired, the path to the current lock otherwise

Overrides StoreInterface::lock

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php, line 72

Class

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

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function lock(Request $request) {
  if (false !== ($lock = @fopen($path = $this
    ->getPath($this
    ->getCacheKey($request) . '.lck'), 'x'))) {
    fclose($lock);
    $this->locks[] = $path;
    return true;
  }
  return $path;
}