Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 3 Jan 2018 23:26:07 +0000 (00:26 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 3 Jan 2018 23:26:07 +0000 (00:26 +0100)
- first check path, then file

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/file_directories/io/class_FrameworkFileInputOutputPointer.php

index 556942d..971b3ac 100644 (file)
@@ -67,12 +67,12 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                } elseif ((!FrameworkBootstrap::isReadableFile($fileInstance)) && (file_exists($fileInstance))) {
                        // File exists but cannot be read
                        throw new FileReadProtectedException($fileInstance, self::EXCEPTION_FILE_CANNOT_BE_READ);
-               } elseif (($fileInstance->isFile()) && (!$fileInstance->isWritable())) {
-                       // File exists but cannot be written
-                       throw new FileWriteProtectedException($fileInstance, self::EXCEPTION_FILE_CANNOT_BE_WRITTEN);
                } elseif (!is_writable($fileInstance->getPath())) {
                        // Path is not writable
                        throw new PathWriteProtectedException($fileInstance, self::EXCEPTION_PATH_CANNOT_BE_WRITTEN);
+               } elseif (($fileInstance->isFile()) && (!$fileInstance->isWritable())) {
+                       // File exists but cannot be written
+                       throw new FileWriteProtectedException($fileInstance, self::EXCEPTION_FILE_CANNOT_BE_WRITTEN);
                }
 
                // Try to open a handler