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