Handle cases where directory is not writable

This commit is contained in:
Samuel Georges 2016-08-27 13:27:57 +10:00
parent 1e0741e407
commit dd06cd13fa
1 changed files with 4 additions and 0 deletions

View File

@ -317,6 +317,10 @@ class CodeParser
$count = 0;
$dir = dirname($path);
if (is_dir($dir) && !is_writable($dir)) {
throw new SystemException(Lang::get('system::lang.directory.create_fail', ['name'=>$dir]));
}
while (!is_dir($dir) && !@mkdir($dir, 0777, true)) {
usleep(rand(50000, 200000));