Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
vendor/symfony/http-kernel/HttpCache
23
vendor/symfony/http-kernel/HttpCache/Store.php
vendored
23
vendor/symfony/http-kernel/HttpCache/Store.php
vendored
|
@ -32,12 +32,14 @@ class Store implements StoreInterface
|
|||
* Constructor.
|
||||
*
|
||||
* @param string $root The path to the cache directory
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function __construct($root)
|
||||
{
|
||||
$this->root = $root;
|
||||
if (!is_dir($this->root)) {
|
||||
mkdir($this->root, 0777, true);
|
||||
if (!is_dir($this->root) && !@mkdir($this->root, 0777, true) && !is_dir($this->root)) {
|
||||
throw new \RuntimeException(sprintf('Unable to create the store directory (%s).', $this->root));
|
||||
}
|
||||
$this->keyCache = new \SplObjectStorage();
|
||||
$this->locks = array();
|
||||
|
@ -74,7 +76,7 @@ class Store implements StoreInterface
|
|||
public function lock(Request $request)
|
||||
{
|
||||
$path = $this->getPath($this->getCacheKey($request).'.lck');
|
||||
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) {
|
||||
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true) && !is_dir(dirname($path))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -106,7 +108,10 @@ class Store implements StoreInterface
|
|||
|
||||
public function isLocked(Request $request)
|
||||
{
|
||||
return is_file($this->getPath($this->getCacheKey($request).'.lck'));
|
||||
$path = $this->getPath($this->getCacheKey($request).'.lck');
|
||||
clearstatcache(true, $path);
|
||||
|
||||
return is_file($path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -242,10 +247,8 @@ class Store implements StoreInterface
|
|||
}
|
||||
}
|
||||
|
||||
if ($modified) {
|
||||
if (false === $this->save($key, serialize($entries))) {
|
||||
throw new \RuntimeException('Unable to store the metadata.');
|
||||
}
|
||||
if ($modified && false === $this->save($key, serialize($entries))) {
|
||||
throw new \RuntimeException('Unable to store the metadata.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +269,7 @@ class Store implements StoreInterface
|
|||
}
|
||||
|
||||
foreach (preg_split('/[\s,]+/', $vary) as $header) {
|
||||
$key = strtr(strtolower($header), '_', '-');
|
||||
$key = str_replace('_', '-', strtolower($header));
|
||||
$v1 = isset($env1[$key]) ? $env1[$key] : null;
|
||||
$v2 = isset($env2[$key]) ? $env2[$key] : null;
|
||||
if ($v1 !== $v2) {
|
||||
|
@ -338,7 +341,7 @@ class Store implements StoreInterface
|
|||
private function save($key, $data)
|
||||
{
|
||||
$path = $this->getPath($key);
|
||||
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) {
|
||||
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true) && !is_dir(dirname($path))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue