]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/output/raw/class_FrameworkRawFileOutputPointer.php
Continued:
[core.git] / framework / main / classes / file_directories / output / raw / class_FrameworkRawFileOutputPointer.php
index 61eb1705ecf574ac099887cd5d8881d1c4ada74c..6d2c3a26b4189fd59c0300bad7cf93b91dbd152a 100644 (file)
@@ -59,14 +59,14 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         */
        public static final function createFrameworkRawFileOutputPointer (SplFileInfo $fileInstance, string $mode) {
                // Is the parameter valid?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-OUTPUT-POINTER: fileInstance=%s,mode=%s - CALLED!', $fileInstance->__toString(), $mode));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: fileInstance=%s,mode=%s - CALLED!', $fileInstance->__toString(), $mode));
                if (empty($mode)) {
                        // No fileInstance given
                        throw new InvalidArgumentException('Parameter "mode" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Try to open a handler
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-OUTPUT-POINTER: Invoking fileInstance->openFile(%s) ...', $mode));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: Invoking fileInstance->openFile(%s) ...', $mode));
                $fileObject = $fileInstance->openFile($mode);
 
                // Is it valid?
@@ -85,7 +85,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
                $pointerInstance->setFileObject($fileObject);
 
                // Return the instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-OUTPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: pointerInstance=%s - EXIT!', $pointerInstance->__toString()));
                return $pointerInstance;
        }
 
@@ -100,19 +100,20 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         */
        public function writeToFile (string $dataStream) {
                // Validate parameter and class own attributes
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-FILE-OUTPUT-POINTER: dataStream(%d)=%s (trimmed) - CALLED!', strlen($dataStream), trim($dataStream)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: dataStream(%d)=%s (trimmed) - CALLED!', strlen($dataStream), trim($dataStream)));
                if (empty($dataStream)) {
                        // Empty data stream
                        throw new InvalidArgumentException('Parameter "dataStream" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                } elseif (is_null($this->getFileObject())) {
                        // Pointer not initialized
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       throw new NullPointerException($this, FrameworkInterface::EXCEPTION_IS_NULL_POINTER);
                } elseif (!is_object($this->getFileObject())) {
                        // Pointer is not a valid resource!
                        throw new LogicException(sprintf('this->fileObject[]=%s is no object', gettype($this->getFileObject())), FrameworkInterface::EXCEPTION_LOGIC_EXCEPTION);
                }
 
                // Write data to the file pointer and return written bytes
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-OUTPUT-POINTER: Invoking this->fileObject->fwrite(dataStream()=%d - EXIT!', strlen($dataStream)));
                return $this->getFileObject()->fwrite($dataStream);
        }