]> git.mxchange.org Git - core.git/blobdiff - inc/main/classes/file_directories/class_BaseFileIo.php
renamed lib-local.php -> lib-lfdb.php because it really loads the "legendary"
[core.git] / inc / main / classes / file_directories / class_BaseFileIo.php
index 2f9b6f8da33786d73cbb369db865de696bca74af..829557eadb8866c1bbec63d7a25c068c46197da7 100644 (file)
@@ -1,10 +1,17 @@
 <?php
+// Own namespace
+namespace CoreFramework\FileSystem;
+
+// Import framework stuff
+use CoreFramework\Generic\NullPointerException;
+use CoreFramework\Object\BaseFrameworkSystem;
+
 /**
  * A general FileIo class
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -69,7 +76,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi
         */
        public function closeFile () {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName()));
 
                if (is_null($this->getPointer())) {
                        // Pointer not initialized
@@ -80,7 +87,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi
                }
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Closing file %s ...', __METHOD__, __LINE__, $this->getFileName()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: Closing file %s ...', __METHOD__, __LINE__, $this->getFileName()));
 
                // Close the file pointer and reset the instance variable
                @fclose($this->getPointer());
@@ -88,7 +95,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi
                $this->setFileName('');
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__));
        }
 
        /**
@@ -160,7 +167,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi
                $status = fseek($this->getPointer(), $offset, $whence);
 
                // Return status
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] status=%d', __METHOD__, __LINE__, $status));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] status=%d', __METHOD__, __LINE__, $status));
                return $status;
        }
 
@@ -171,14 +178,14 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi
         * @todo        Handle seekStatus
         */
        public function size () {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
 
                // Get current seek position
                $seekPosition = $this->determineSeekPosition();
 
                // Seek to end
                $seekStatus = $this->seek(0, SEEK_END);
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekStatus=%d', __METHOD__, __LINE__, $seekStatus));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekStatus=%d', __METHOD__, __LINE__, $seekStatus));
 
                // Get position again  (which is the end of the file)
                $size = $this->determineSeekPosition();
@@ -187,10 +194,8 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi
                $this->seek($seekPosition);
 
                // Return size
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] size=%s - EXIT!', __METHOD__, __LINE__, $size));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] size=%s - EXIT!', __METHOD__, __LINE__, $size));
                return $size;
        }
-}
 
-// [EOF]
-?>
+}