]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/io/class_FrameworkFileInputOutputPointer.php
imported UnsupportedOperationException;
[core.git] / framework / main / classes / file_directories / io / class_FrameworkFileInputOutputPointer.php
index d7f8ef742b3d6af8775f79321df6933fe8e0700b..e1a0b5983fbeeab97c15d2e2908838271da5d724 100644 (file)
@@ -3,7 +3,13 @@
 namespace CoreFramework\Filesystem\Pointer;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
+use CoreFramework\FileSystem\BaseFileIo;
+use CoreFramework\FileSystem\FileReadProtectedException;
+use CoreFramework\FileSystem\FileWriteProtectedException;
+use CoreFramework\Filesystem\PathWriteProtectedException;
 use CoreFramework\Generic\NullPointerException;
+use CoreFramework\Generic\UnsupportedOperationException;
 use CoreFramework\Object\BaseFrameworkSystem;
 
 /**
@@ -56,10 +62,10 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                if ((is_null($fileName)) || (empty($fileName))) {
                        // No filename given
                        throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) {
+               } elseif (!FrameworkBootstrap::isReachableFilePath($fileName)) {
                        // File exists but cannot be read
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE);
-               } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (file_exists($fileName))) {
+               } elseif ((!FrameworkBootstrap::isReadableFile($fileName)) && (file_exists($fileName))) {
                        // File exists but cannot be read
                        throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
                } elseif ((file_exists($fileName)) && (!is_writable($fileName))) {
@@ -72,7 +78,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
 
                // Try to open a handler
                $filePointer = fopen($fileName, 'c+b');
-               if ((is_null($filePointer)) || ($filePointer === FALSE)) {
+               if ((is_null($filePointer)) || ($filePointer === false)) {
                        // Something bad happend
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
                } // END - if
@@ -128,7 +134,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         * Write data to a file pointer
         *
         * @param       $dataStream             The data stream we shall write to the file
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         */
        public function writeToFile ($dataStream) {
                // Validate the pointer
@@ -143,7 +149,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         *
         * @param       $seekPosition   Seek position in file
         * @param       $data                   Data to be written
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         */
        public function writeAtPosition ($seekPosition, $data) {
                // First seek to it
@@ -238,7 +244,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         * @throws      UnsupportedOperationException   If this method is called