]> git.mxchange.org Git - mailer.git/blobdiff - inc/classes/main/io/class_FrameworkFileOutputPointer.php
More code merged from ship-simu
[mailer.git] / inc / classes / main / io / class_FrameworkFileOutputPointer.php
index 439b12327cc1ea5dc51ac05ca226ed3096075803..73cf90804d48f25bc715d079cdce09a9b0e81fc5 100644 (file)
@@ -1,6 +1,25 @@
 <?php
 /**
  * A class for writing files
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
@@ -14,17 +33,17 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        private $filePointer = null;
 
        /**
-        * Private constructor
+        * Protected constructor
         */
-       private final function __construct () {
+       protected function __construct () {
                // Call parent constructor
-               parent::constructor(__CLASS__);
+               parent::__construct(__CLASS__);
 
                // Set part description
-               $this->setPartDescr("Dateiausgabe-Handler");
+               $this->setObjectDescription("Handler for writing to files");
 
                // Create unique ID
-               $this->createUniqueID();
+               $this->generateUniqueId();
 
                // Clean-up a little
                $this->removeNumberFormaters();
@@ -48,12 +67,11 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
         * Create a file pointer based on the given file. The file will also
         * be verified here.
         *
-        * @param               $fileName                               The file name we shall pass
-        *                                                              to fopen()
-        * @param               $mode                           The output mode ('w', 'a' are valid)
+        * @param       $fileName       The file name we shall pass to fopen()
+        * @param       $mode           The output mode ('w', 'a' are valid)
         * @throws      FileIsEmptyException    If the provided file name is empty.
         * @throws      FilePointerNotOpened    If fopen() returns not a file
-        *                                                              resource
+        *                                                                      resource
         * @return      void
         */
        public final static function createFrameworkFileOutputPointer ($fileName, $mode) {
@@ -84,12 +102,12 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * Write data to a file pointer
         *
-        * @param               $dataStream     The data stream we shall write to the file
-        * @return      mixed           The result of fwrite()
+        * @param       $dataStream             The data stream we shall write to the file
+        * @return      mixed                   The result of fwrite()
         * @throws      NullPointerException    If the file pointer instance
-        *                                                              is not set by setPointer()
+        *                                                                      is not set by setPointer()
         * @throws      InvalidFileResourceException    If there is being set
-        *                                                                      an invalid file resource
+        *                                                                                      an invalid file resource
         */
        public function writeToFile ($dataStream) {
                if (is_null($this->getPointer())) {
@@ -110,7 +128,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
         *
         * @return      void
         * @throws      NullPointerException    If the file pointer instance
-        *                                                              is not set by setPointer()
+        *                                                                      is not set by setPointer()
         * @throws      InvalidFileResourceException    If there is being set
         */
        public function closeFile () {
@@ -131,7 +149,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * Setter for the file pointer
         *
-        * @param               $filePointer    File resource
+        * @param       $filePointer    File resource
         * @return      void
         */
        public final function setPointer ($filePointer) {
@@ -149,7 +167,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
         * Getter for the file pointer
         *
         * @return      $filePointer    The file pointer which shall be a valid
-        *                                              file resource
+        *                                                      file resource
         */
        public final function getPointer () {
                return $this->filePointer;
@@ -158,7 +176,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * Setter for file name
         *
-        * @param               $fileName               The new file name
+        * @param       $fileName       The new file name
         * @return      void
         */
        public final function setFileName ($fileName) {
@@ -169,7 +187,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * Getter for file name
         *
-        * @return      $fileName               The current file name
+        * @return      $fileName       The current file name
         */
        public final function getFileName () {
                return $this->fileName;