Don't "abuse" setters for actually "unsetting" (closing) instances. Better use
[core.git] / inc / classes / main / file_directories / class_BaseFileIo.php
index 9b762693b34658dfb6e74f08f03f5ca16f380b62..df6d0321c52f5473bf6b0526d733a4531e2a1a2d 100644 (file)
@@ -67,7 +67,7 @@ class BaseFileIo extends BaseFrameworkSystem {
         * @throws      NullPointerException    If the file pointer instance is not set by setPointer()
         * @throws      InvalidResourceException        If there is being set
         */
-       public function closeFile () {
+       private function closeFile () {
                // Debug message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName()));
 
@@ -79,6 +79,9 @@ class BaseFileIo extends BaseFrameworkSystem {
                        throw new InvalidResourceException($this, self::EXCEPTION_INVALID_RESOURCE);
                }
 
+               // Debug message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Closing file %s ...', __METHOD__, __LINE__, $this->getFileName()));
+
                // Close the file pointer and reset the instance variable
                @fclose($this->getPointer());
                $this->setPointer(NULL);