From 32fe31b8ec8dc8e7fefe7343e9be44fbb8f94895 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 10 Mar 2015 01:40:30 +0100 Subject: [PATCH] Renamed BaseFile to BaseAbstractFile to make it more clear that this class is an abstracted file and is not responsible for the actual I/O (which is done by the linked pointer instance). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../file_directories/binary/class_BaseBinaryFile.php | 2 +- ...{class_BaseFile.php => class_BaseAbstractFile.php} | 11 +++++++---- .../main/file_directories/class_BaseFileIo.php | 6 ++++++ .../main/file_directories/text/class_BaseTextFile.php | 2 +- .../text/output/class_BaseOutputTextFile.php | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) rename inc/classes/main/file_directories/{class_BaseFile.php => class_BaseAbstractFile.php} (91%) diff --git a/inc/classes/main/file_directories/binary/class_BaseBinaryFile.php b/inc/classes/main/file_directories/binary/class_BaseBinaryFile.php index 207f797d..678bf455 100644 --- a/inc/classes/main/file_directories/binary/class_BaseBinaryFile.php +++ b/inc/classes/main/file_directories/binary/class_BaseBinaryFile.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseBinaryFile extends BaseFile { +class BaseBinaryFile extends BaseAbstractFile { /** * Separator for header data */ diff --git a/inc/classes/main/file_directories/class_BaseFile.php b/inc/classes/main/file_directories/class_BaseAbstractFile.php similarity index 91% rename from inc/classes/main/file_directories/class_BaseFile.php rename to inc/classes/main/file_directories/class_BaseAbstractFile.php index 0d1bb418..ee91ef17 100644 --- a/inc/classes/main/file_directories/class_BaseFile.php +++ b/inc/classes/main/file_directories/class_BaseAbstractFile.php @@ -1,6 +1,6 @@ * @version 0.0.0 @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseFile extends BaseFrameworkSystem { +class BaseAbstractFile extends BaseFrameworkSystem { /** * Counter for total entries */ @@ -132,13 +132,16 @@ class BaseFile extends BaseFrameworkSystem { * to empty * * @return void - * @todo ~10% done? */ public function closeFile () { - $this->partialStub('Unfinished method.'); + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName())); // Remove file name $this->setFileName(''); + + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__)); } /** diff --git a/inc/classes/main/file_directories/class_BaseFileIo.php b/inc/classes/main/file_directories/class_BaseFileIo.php index f449f11d..e1b7c506 100644 --- a/inc/classes/main/file_directories/class_BaseFileIo.php +++ b/inc/classes/main/file_directories/class_BaseFileIo.php @@ -68,6 +68,9 @@ class BaseFileIo extends BaseFrameworkSystem { * @throws InvalidResourceException If there is being set */ public function closeFile () { + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName())); + if (is_null($this->getPointer())) { // Pointer not initialized throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); @@ -80,6 +83,9 @@ class BaseFileIo extends BaseFrameworkSystem { @fclose($this->getPointer()); $this->setPointer(NULL); $this->setFileName(''); + + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__)); } /** diff --git a/inc/classes/main/file_directories/text/class_BaseTextFile.php b/inc/classes/main/file_directories/text/class_BaseTextFile.php index 1c15afa0..1d306738 100644 --- a/inc/classes/main/file_directories/text/class_BaseTextFile.php +++ b/inc/classes/main/file_directories/text/class_BaseTextFile.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseTextFile extends BaseFile { +class BaseTextFile extends BaseAbstractFile { /** * Protected constructor * diff --git a/inc/classes/main/file_directories/text/output/class_BaseOutputTextFile.php b/inc/classes/main/file_directories/text/output/class_BaseOutputTextFile.php index 63052f00..1a5bbafb 100644 --- a/inc/classes/main/file_directories/text/output/class_BaseOutputTextFile.php +++ b/inc/classes/main/file_directories/text/output/class_BaseOutputTextFile.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseOutputTextFile extends BaseFile { +class BaseOutputTextFile extends BaseAbstractFile { /** * Protected constructor * -- 2.39.5