X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fdatabase%2Fclasses%2Fclass_LocalFileDatabase.php;h=ea4a8e19e49db057d7385fb2c677fe0092aa7391;hp=231dfee213994edc114b4f10a76fad8070f91910;hb=5777454e3cb94e615c74efc485509f08e1aec63d;hpb=014feb51ca186f4b66edeee7dca62a190dff0564 diff --git a/inc/classes/main/database/classes/class_LocalFileDatabase.php b/inc/classes/main/database/classes/class_LocalFileDatabase.php index 231dfee213..ea4a8e19e4 100644 --- a/inc/classes/main/database/classes/class_LocalFileDatabase.php +++ b/inc/classes/main/database/classes/class_LocalFileDatabase.php @@ -34,11 +34,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend */ private $fileExtension = "serialized"; - /** - * The IO handler for file handling which should be FileIOHandler. - */ - private $ioInstance = null; - /** * 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); - $dbInstance->setIOInstance($ioInstance); + $dbInstance->setFileIOInstance($ioInstance); // Return database instance return $dbInstance; @@ -146,15 +141,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend 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 @@ -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. - $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 - $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 @@ -324,34 +310,13 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend 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 */ - private function setLastFile ($fqfn) { + private final function setLastFile ($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 */ - private function setLastFileContents ($contents) { + private final function setLastFileContents ($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 - $inputHandler = $this->getIOInstance(); + $inputHandler = $this->getFileIOInstance(); // Get last file's name and contents $fqfn = $this->repairFQFN($this->getLastFile(), $uniqueID);