A lot more old methods deprecated and already deprecated methods removed
[shipsimu.git] / inc / classes / main / database / databases / class_LocalFileDatabase.php
index 27ba98e66761e46cc89c921bc6859facf91975ca..417c861ea61d8fe5176c156bc87468c0cfab01aa 100644 (file)
@@ -150,60 +150,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $this->lastException;
        }
 
-       /**
-        * Saves a given object to the local file system by serializing and
-        * transparently compressing it
-        *
-        * @param       $object                                 The object we shall save to the local file system
-        * @return      void
-        * @deprecated
-        */
-       public final function saveObject (FrameworkInterface $object) {
-               // 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);
-
-               // Get a path name plus file name and append the extension
-               $fqfn = $this->getSavePath() . $object->getPathFileNameFromObject() . "." . $this->getFileExtension();
-
-               // Save the file to disc we don't care here if the path is there,
-               // this must be done in later methods.
-               $this->getFileIoInstance()->saveFile($fqfn, array($this->getCompressorChannel()->getCompressorExtension(), $serialized));
-       }
-
-       /**
-        * Get a serialized string from the given object
-        *
-        * @param       $object                 The object we want to serialize and transparently
-        *                                                      compress
-        * @return      $serialized             A string containing the serialzed/compressed object
-        * @see         ObjectLimits    An object holding limition information
-        * @see         SerializationContainer  A special container class for e.g.
-        *                                                                      attributes from limited objects
-        * @deprecated
-        */
-       private function serializeObject (FrameworkInterface $object) {
-               // If there is no limiter instance we serialize the whole object
-               // otherwise only in the limiter object (ObjectLimits) specified
-               // attributes summarized in a special container class
-               if ($this->getLimitInstance() === null) {
-                       // Serialize the whole object. This tribble call is the reason
-                       // why we need a fall-back implementation in CompressorChannel
-                       // of the methods compressStream() and decompressStream().
-                       $serialized = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($object));
-               } else {
-                       // Serialize only given attributes in a special container
-                       $container = SerializationContainer::createSerializationContainer($this->getLimitInstance(), $object);
-
-                       // Serialize the container
-                       $serialized = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($container));
-               }
-
-               // Return the serialized object string
-               return $serialized;
-       }
-
        /**
         * Analyses if a unique ID has already been used or not by search in the
         * local database folder.
@@ -371,6 +317,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         *                                                                      is not an object instance
         * @throws      MissingMethodException  If the required method
         *                                                                      toString() is missing
+        * @deprecated
         */
        public final function getObjectFromCachedData ($uniqueID) {
                // Get instance for file handler
@@ -416,13 +363,14 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        /**
         * Private method for re-gathering (repairing) the FQFN
         *
-        * @param               $fqfn           The current FQFN we shall validate
-        * @param               $uniqueID               The unique ID number
+        * @param       $fqfn           The current FQFN we shall validate
+        * @param       $uniqueID       The unique ID number
         * @return      $fqfn           The repaired FQFN when it is empty
         * @throws      NoArrayCreatedException         If explode() has not
-        *                                                                      created an array
+        *                                                                              created an array
         * @throws      InvalidArrayCountException      If the array count is not
-        *                                                                      as the expected
+        *                                                                              as the expected
+        * @deprecated
         */
        private function repairFQFN ($fqfn, $uniqueID) {
                // Cast both strings
@@ -461,6 +409,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         * @param               $contents               The (maybe) already cached contents as an array
         * @param               $fqfn           The current FQFN we shall validate
         * @return      $contents               The repaired contents from the given file
+        * @deprecated
         */
        private function repairContents ($contents, $fqfn) {
                // Is there some content and header (2 indexes) in?
@@ -533,48 +482,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                /* @TODO Do some checks on the database directory and files here */
        }
 
-       /**
-        * Loads data saved with saveObject from the database and re-creates a
-        * full object from it.
-        * If limitObject() was called before a new object ObjectContainer with
-        * all requested attributes will be returned instead.
-        *
-        * @return      Object  The fully re-created object or instance to
-        *                                      ObjectContainer
-        * @throws      SavePathIsEmptyException                If the given save path is an
-        *                                                                                      empty string
-        * @throws      SavePathIsNoDirectoryException  If the save path is no
-        *                                                                                      path (e.g. a file)
-        * @throws      SavePathReadProtectedException  If the save path is read-
-        *                                                                                      protected
-        * @throws      SavePathWriteProtectedException If the save path is write-
-        *                                                                                      protected
-        */
-       public function loadObject () {
-               // Already connected? Then abort here
-               if ($this->alreadyConnected === true) return true;
-
-               // Get the save path
-               $savePath = $this->getSavePath();
-
-               if (empty($savePath)) {
-                       // Empty string
-                       throw new SavePathIsEmptyException($dbInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!is_dir($savePath)) {
-                       // Is not a dir
-                       throw new SavePathIsNoDirectoryException($savePath, self::EXCEPTION_INVALID_PATH_NAME);
-               } elseif (!is_readable($savePath)) {
-                       // Path not readable
-                       throw new SavePathReadProtectedException($savePath, self::EXCEPTION_READ_PROTECED_PATH);
-               } elseif (!is_writeable($savePath)) {
-                       // Path not writeable
-                       throw new SavePathWriteProtectedException($savePath, self::EXCEPTION_WRITE_PROTECED_PATH);
-               }
-
-               // "Connection" established... ;-)
-               $this->alreadyConnected = true;
-       }
-
        /**
         * Starts a SELECT query on the database by given return type, table name
         * and search criteria