Files merged from ship-simu project
[mailer.git] / inc / classes / main / database / classes / class_LocalFileDatabase.php
index 3f207c8499a1e2686f3889516fc36efd382d9bc6..84babfeafd6d6d0fcf8d1a0e1c23da517cbd0203 100644 (file)
@@ -5,10 +5,10 @@
  * This class serializes objects and saves them to local files.
  *
  * @author             Roland Haeder <webmaster@mxchange.org>
- * @version            0.3.0
+ * @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.mxchange.org
+ * @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
@@ -21,7 +21,7 @@
  * 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/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontendInterface {
        /**
@@ -50,9 +50,9 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         *
         * @return      void
         */
-       private function __construct() {
+       protected function __construct() {
                // Call parent constructor
-               parent::constructor(__CLASS__);
+               parent::__construct(__CLASS__);
 
                // Set description
                $this->setObjectDescription("Dateidatenbankschicht");
@@ -99,11 +99,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                        throw new SavePathWriteProtectedException($savePath, self::EXCEPTION_WRITE_PROTECED_PATH);
                }
 
-               // Debug output
-               if (defined('DEBUG_DATABASE')) $dbInstance->getDebugInstance()->output(sprintf("[%s:] Es werden lokale Dateien zum Speichern von Objekten verwendet.<br />\n",
-                       $dbInstance->__toString()
-               ));
-
                // Set save path and IO instance
                $dbInstance->setSavePath($savePath);
                $dbInstance->setFileIOInstance($ioInstance);
@@ -122,12 +117,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                // Secure string
                $savePath = (string) $savePath;
 
-               // Debug message
-               if ((defined('DEBUG_DATABASE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:] Lokaler Speicherpfad <strong>%s</strong> wird verwendet.<br />\n",
-                       $this->__toString(),
-                       $savePath
-               ));
-
                // Set save path
                $this->savePath = $savePath;
        }
@@ -164,24 +153,11 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                        throw new MissingMethodException(array($object, '__toString'), self::EXCEPTION_MISSING_METHOD);
                }
 
-               // Debug message
-               if ((defined('DEBUG_DATABASE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt <strong>%s</strong> soll in eine lokale Datei gespeichert werden.<br />\n",
-                       $this->__toString(),
-                       $object->__toString()
-               ));
-
                // Get a string containing the serialized object. We cannot exchange
                // $this and $object here because $object does not need to worry
                // about it's limitations... ;-)
                $serialized = $this->serializeObject($object);
 
-               // Debug message
-               if ((defined('DEBUG_DATABASE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:] Das Objekt <strong>%s</strong> ist nach der Serialisierung <strong>%s</strong> Byte gross.<br />\n",
-                       $this->__toString(),
-                       $object->__toString(),
-                       strlen($serialized)
-               ));
-
                // Get a path name plus file name and append the extension
                $fqfn = $this->getSavePath() . $object->getPathFileNameFromObject() . "." . $this->getFileExtension();