more 'final' statements added
[mailer.git] / inc / classes / main / database / classes / class_LocalFileDatabase.php
index 231dfee213994edc114b4f10a76fad8070f91910..ea4a8e19e49db057d7385fb2c677fe0092aa7391 100644 (file)
@@ -34,11 +34,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        private $fileExtension = "serialized";
 
         */
        private $fileExtension = "serialized";
 
-       /**
-        * The IO handler for file handling which should be FileIOHandler.
-        */
-       private $ioInstance = null;
-
        /**
         * The last read file's name
         */
        /**
         * The last read file's name
         */
@@ -111,7 +106,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
 
                // Set save path and IO instance
                $dbInstance->setSavePath($savePath);
 
                // Set save path and IO instance
                $dbInstance->setSavePath($savePath);
-               $dbInstance->setIOInstance($ioInstance);
+               $dbInstance->setFileIOInstance($ioInstance);
 
                // Return database instance
                return $dbInstance;
 
                // Return database instance
                return $dbInstance;
@@ -146,15 +141,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $this->savePath;
        }
 
                return $this->savePath;
        }
 
-       /**
-        * Getter for file extension
-        *
-        * @return      $fileExtension          The file extension for all file names
-        */
-       public final function getFileExtension () {
-               return $this->fileExtension;
-       }
-
        /**
         * Saves a given object to the local file system by serializing and
         * transparently compressing it
        /**
         * Saves a given object to the local file system by serializing and
         * transparently compressing it
@@ -201,7 +187,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
 
                // Save the file to disc we don't care here if the path is there,
                // this must be done in later methods.
 
                // Save the file to disc we don't care here if the path is there,
                // this must be done in later methods.
-               $this->getIOInstance()->saveFile($fqfn, array($this->getCompressorChannel()->getCompressorExtension(), $serialized));
+               $this->getFileIOInstance()->saveFile($fqfn, array($this->getCompressorChannel()->getCompressorExtension(), $serialized));
        }
 
        /**
        }
 
        /**
@@ -301,7 +287,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                        $this->setLastFile($fqfn);
 
                        // Get instance for file handler
                        $this->setLastFile($fqfn);
 
                        // Get instance for file handler
-                       $inputHandler = $this->getIOInstance();
+                       $inputHandler = $this->getFileIOInstance();
 
                        // Try to read from it. This makes it sure that the file is
                        // readable and a valid database file
 
                        // Try to read from it. This makes it sure that the file is
                        // readable and a valid database file
@@ -324,34 +310,13 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $isUsed;
        }
 
                return $isUsed;
        }
 
-       /**
-        * Getter for the file IO instance
-        *
-        *�@return    $ioInstance     An instance for IO operations
-        * @see         FileIOHandler   The concrete handler for IO operations
-        */
-       public final function getIOInstance () {
-               return $this->ioInstance;
-       }
-
-       /**
-        * Setter for the file IO instance
-        *
-        * @param               $ioInstance     An instance for IO operations (should be
-        *                                              FileIOHandler)
-        * @return      void
-        */
-       public final function setIOInstance (FileIOHandler $ioInstance) {
-               $this->ioInstance = $ioInstance;
-       }
-
        /**
         * Setter for the last read file
         *
         * @param               $fqfn   The FQFN of the last read file
         * @return      void
         */
        /**
         * Setter for the last read file
         *
         * @param               $fqfn   The FQFN of the last read file
         * @return      void
         */
-       private function setLastFile ($fqfn) {
+       private final function setLastFile ($fqfn) {
                // Cast string
                $fqfn = (string) $fqfn;
                $this->lastFile = $fqfn;
                // Cast string
                $fqfn = (string) $fqfn;
                $this->lastFile = $fqfn;
@@ -372,7 +337,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         * @param               $contents               An array with header and data elements
         * @return      void
         */
         * @param               $contents               An array with header and data elements
         * @return      void
         */
-       private function setLastFileContents ($contents) {
+       private final function setLastFileContents ($contents) {
                // Cast array
                $contents = (array) $contents;
                $this->lastContents = $contents;
                // Cast array
                $contents = (array) $contents;
                $this->lastContents = $contents;
@@ -406,7 +371,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        public final function getObjectFromCachedData ($uniqueID) {
                // Get instance for file handler
         */
        public final function getObjectFromCachedData ($uniqueID) {
                // Get instance for file handler
-               $inputHandler = $this->getIOInstance();
+               $inputHandler = $this->getFileIOInstance();
 
                // Get last file's name and contents
                $fqfn = $this->repairFQFN($this->getLastFile(), $uniqueID);
 
                // Get last file's name and contents
                $fqfn = $this->repairFQFN($this->getLastFile(), $uniqueID);