Skip to content
Permalink
Browse files

Use more atomic options when creating directories.

Using `is_dir` and then `mkdir` creates an opportunity for a concurrent
process to create the directory at the same time resulting in `mkdir()`
emitting an error. We can always create the directory and silence the
warning to avoid that issue.

Refs #10530
  • Loading branch information...
markstory committed Sep 14, 2017
1 parent 8262b4d commit c666593663bbea6c5ed05abb9986de2d98815669
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Cache/Engine/FileEngine.php
@@ -380,9 +380,10 @@ protected function _setKey($key, $createKey = false)
}
$dir = $this->_config['path'] . $groups;
if (!is_dir($dir)) {
mkdir($dir, 0775, true);
}
// @codingStandardsIgnoreStart
@mkdir($dir, 0775, true);
// @codingStandardsIgnoreEnd
$path = new SplFileInfo($dir . $key);
if (!$createKey && !$path->isFile()) {

0 comments on commit c666593

Please sign in to comment.
You can’t perform that action at this time.