* @throws FileIsEmptyException If the provided file name is empty.
* @throws FileIoException If the file is not reachable
* @throws FileReadProtectedException If the file is not found or cannot be read
+ * @throws FileNotFoundException If the file does not exist
* @return void
*/
public static final function createFrameworkRawFileInputPointer ($fileName) {
// No filename given
throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) {
- // File does not exist!
+ // File cannot be accessed (due to open_basedir restriction)
throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE);
- } elseif (!BaseFrameworkSystem::isReadableFile($fileName)) {
- // File does not exist!
+ } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (file_exists($fileName))) {
+ // File exists but cannot be read from
throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
+ } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (!file_exists($fileName))) {
+ // File does not exist
+ throw new FileNotFoundException($fileName, self::EXCEPTION_FILE_NOT_FOUND);
}
// Try to open a handler