Fixes #9288: Fixed FileHelper::createDirectory directory creation to be concurrency friendly

This commit is contained in:
Boudewijn Vahrmeijer
2015-08-03 12:40:50 +02:00
committed by Alexander Makarov
parent 5569eaae06
commit 4d21c48bc4
2 changed files with 4 additions and 0 deletions

View File

@ -462,6 +462,9 @@ class BaseFileHelper
$result = mkdir($path, $mode);
chmod($path, $mode);
} catch (\Exception $e) {
if(is_dir($path)){ // #9288
return true;
}
throw new \yii\base\Exception("Failed to create directory '$path': " . $e->getMessage(), $e->getCode(), $e);
}