Handle mkdir errors with exceptions
This commit is contained in:
parent
51df34477c
commit
fdcbb86f43
|
@ -113,7 +113,9 @@ class Resize
|
|||
{
|
||||
// Create directory with write permissions
|
||||
if (null !== $path && !file_exists(dirname($path))) {
|
||||
mkdir(dirname($path), 0777, true);
|
||||
if (!@mkdir(dirname($path), 0755, true)) {
|
||||
throw new Exception('Can\'t create directory '.dirname($path));
|
||||
}
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
|
|
|
@ -71,7 +71,7 @@ abstract class Device
|
|||
}
|
||||
|
||||
if (!file_exists(dirname($path))) { // Checks if directory path to file exists
|
||||
if (!mkdir(dirname($path), 0755, true)) {
|
||||
if (!@mkdir(dirname($path), 0755, true)) {
|
||||
throw new Exception('Can\'t create directory '.dirname($path));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue