]> git.mxchange.org Git - core.git/blobdiff - inc/classes/middleware/io/class_FileIoHandler.php
Rewrote core:
[core.git] / inc / classes / middleware / io / class_FileIoHandler.php
index 7d8b8cc80d24b9d240390bb2fc31a20c40a07d68..533dce3e2fb0b7744dd4fa4c6b968c7c0c8656c9 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -26,17 +26,17 @@ class FileIoHandler extends BaseMiddleware {
        /**
         * The *real* file input class we shall use for reading data
         */
-       private $inputStream = null;
+       private $inputStream = NULL;
 
        /**
         * The *real* file output class we shall use for reading data
         */
-       private $outputStream = null;
+       private $outputStream = NULL;
 
        /**
         * An instance of this class
         */
-       private static $thisInstance = null;
+       private static $selfInstance = NULL;
 
        /**
         * Protected constructor
@@ -48,7 +48,7 @@ class FileIoHandler extends BaseMiddleware {
                parent::__construct(__CLASS__);
 
                // Set own instance
-               self::$thisInstance = $this;
+               self::$selfInstance = $this;
        }
 
        /**
@@ -72,10 +72,10 @@ class FileIoHandler extends BaseMiddleware {
        /**
         * Getter for an instance of this class
         *
-        * @return      $thisInstance   An instance of this class
+        * @return      $selfInstance   An instance of this class
         */
-       public static final function getInstance () {
-               return self::$thisInstance;
+       public static final function getSelfInstance () {
+               return self::$selfInstance;
        }
 
        /**
@@ -119,15 +119,22 @@ class FileIoHandler extends BaseMiddleware {
        /**
         * Saves a file with data by using the current output stream
         *
-        * @param       $fileName       Name of the file
-        * @param       $dataArray      Array with file contents
+        * @param       $fileName               Name of the file
+        * @param       $dataStream             File data stream
         * @return      void
         * @see         FileOutputStreamer
         */
-       public function saveFile ($fileName, $dataArray) {
+       public function saveFile ($fileName, $dataStream) {
                // Get output stream
                $outInstance = $this->getOutputStream();
 
+               // Prepare output array
+               $dataArray = array(
+                       // @TODO What is this for?
+                       0 => $this->__toString(),
+                       1 => $dataStream
+               );
+
                // Send the fileName and dataArray to the output handler
                $outInstance->saveFile($fileName, $dataArray);
        }