Avoid race condition
This commit is contained in:
parent
a653e09bf0
commit
b5057f44b1
|
@ -141,7 +141,9 @@ class Sample
|
||||||
{
|
{
|
||||||
$tempFolder = sys_get_temp_dir() . '/phpspreadsheet';
|
$tempFolder = sys_get_temp_dir() . '/phpspreadsheet';
|
||||||
if (!is_dir($tempFolder)) {
|
if (!is_dir($tempFolder)) {
|
||||||
mkdir($tempFolder);
|
if (! mkdir($tempFolder) && ! is_dir($tempFolder)) {
|
||||||
|
throw new \RuntimeException(sprintf('Directory "%s" was not created', $tempFolder));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tempFolder;
|
return $tempFolder;
|
||||||
|
|
Loading…
Reference in New Issue