Rewrote core:
authorRoland Häder <roland@mxchange.org>
Tue, 31 Jul 2012 22:11:43 +0000 (22:11 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 31 Jul 2012 22:11:43 +0000 (22:11 +0000)
- LocalFileDatabase refactured to use FileIoHandler, please DELETE all your
  db/*/*.serialized database files, this "new" file format is incompatible and
  thanks to hashing it is a little more secure.
- A lot other renames/fixes

31 files changed:
inc/classes/interfaces/io/file/class_FileOutputStreamer.php
inc/classes/main/cache/class_MemoryCache.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/compressor/class_Bzip2Compressor.php
inc/classes/main/compressor/class_GzipCompressor.php
inc/classes/main/compressor/class_NullCompressor.php
inc/classes/main/compressor/class_ZlibCompressor.php
inc/classes/main/console/class_ConsoleTools.php
inc/classes/main/container/socket/class_SocketContainer.php
inc/classes/main/controller/class_BaseController.php
inc/classes/main/criteria/class_BaseCriteria.php
inc/classes/main/database/class_BaseDatabaseWrapper.php
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/debug/class_DebugConsoleOutput.php
inc/classes/main/debug/class_DebugErrorLogOutput.php
inc/classes/main/debug/class_DebugWebOutput.php
inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php
inc/classes/main/filter/class_FilterChain.php
inc/classes/main/helper/class_BaseHelper.php
inc/classes/main/io/class_FileIoStream.php
inc/classes/main/io/class_FrameworkDirectoryPointer.php
inc/classes/main/io/class_FrameworkFileInputPointer.php
inc/classes/main/parser/xml/class_XmlParser.php
inc/classes/main/registry/class_BaseRegistry.php
inc/classes/main/resolver/controller/class_BaseControllerResolver.php
inc/classes/main/response/class_BaseResponse.php
inc/classes/main/streams/crypto/class_McryptStream.php
inc/classes/main/streams/crypto/class_NullCryptoStream.php
inc/classes/main/template/class_BaseTemplateEngine.php
inc/classes/middleware/database/class_DatabaseConnection.php
inc/classes/middleware/io/class_FileIoHandler.php

index 0882361fbc87f76940df2ad6b893bfd8d4c4a73b..8840e00464568209bd384e5255dd47052c1cc0f6 100644 (file)
@@ -30,7 +30,7 @@ interface FileOutputStreamer extends Streamable {
         * @param       $dataArray      Array containing the compressor's extension and streamed data
         * @return      void
         */
         * @param       $dataArray      Array containing the compressor's extension and streamed data
         * @return      void
         */
-       function saveFile ($fileName, $dataArray);
+       function saveFile ($fileName, array $dataArray);
 }
 
 // [EOF]
 }
 
 // [EOF]
index ba2cb773d1975bfdccfcb91ecc816bf91a7d9166..55bf24db2e2ee14d1ff67a76ec5dba9847c6b061 100644 (file)
@@ -115,7 +115,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
                // Is the offset there?
                if ($this->offsetExists($offset)) {
                        // Purge only existing keys
                // Is the offset there?
                if ($this->offsetExists($offset)) {
                        // Purge only existing keys
-                       //* DEBUG: */ $this->debugOutput('CACHE: Unsetting cache ' . $offset);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CACHE: Unsetting cache ' . $offset);
                        $this->dataCache->offsetUnset($offset);
                } // END - if
        }
                        $this->dataCache->offsetUnset($offset);
                } // END - if
        }
index 77390bc205f7851427ec7c2c3ff049f5c30ffbb9..76c890825e89be3455f2ff2b0216bc090a6bb146 100644 (file)
@@ -328,7 +328,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * @return      void
         */
         *
         * @return      void
         */
-       public function __destruct() {
+       public function __destruct () {
                // Flush any updated entries to the database
                $this->flushPendingUpdates();
 
                // Flush any updated entries to the database
                $this->flushPendingUpdates();
 
@@ -338,7 +338,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $this->setRealClass('DestructedObject');
                } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
                        // Already destructed object
                        $this->setRealClass('DestructedObject');
                } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) {
                        // Already destructed object
-                       $this->debugOutput(sprintf("[%s:] The object <span class=\"object_name\">%s</span> is already destroyed.",
+                       self::createDebugInstance(__CLASS__)->debugOutput(sprintf("[%s:] The object <span class=\"object_name\">%s</span> is already destroyed.",
                                __CLASS__,
                                $this->__toString()
                        ));
                                __CLASS__,
                                $this->__toString()
                        ));
@@ -353,6 +353,17 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        public final function __call ($methodName, $args) {
         * @return      void
         */
        public final function __call ($methodName, $args) {
+               return self::__callStatic($methodName, $args);
+       }
+
+       /**
+        * The __callStatic() method where all non-implemented static methods end up
+        *
+        * @param       $methodName             Name of the missing method
+        * @args        $args                   Arguments passed to the method
+        * @return      void
+        */
+       public static final function __callStatic ($methodName, $args) {
                // Implode all given arguments
                $argsString = '';
                if (empty($args)) {
                // Implode all given arguments
                $argsString = '';
                if (empty($args)) {
@@ -373,10 +384,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                                if (is_string($arg)) {
                                        // Add length for strings
 
                                if (is_string($arg)) {
                                        // Add length for strings
-                                       $argsString .= ', '.strlen($arg);
+                                       $argsString .= ', ' . strlen($arg);
                                } elseif (is_array($arg)) {
                                        // .. or size if array
                                } elseif (is_array($arg)) {
                                        // .. or size if array
-                                       $argsString .= ', '.count($arg);
+                                       $argsString .= ', ' . count($arg);
                                } elseif ($arg === true) {
                                        // ... is boolean 'true'
                                        $argsString .= ', true';
                                } elseif ($arg === true) {
                                        // ... is boolean 'true'
                                        $argsString .= ', true';
@@ -399,8 +410,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                }
 
                // Output stub message
                }
 
                // Output stub message
-               $this->debugOutput(sprintf("[%s-&gt;%s] Stub! Args: %s",
-                       $this->__toString(),
+               // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class
+               self::createDebugInstance(__CLASS__)->debugOutput(sprintf("[unknown::%s:] Stub! Args: %s",
                        $methodName,
                        $argsString
                ));
                        $methodName,
                        $argsString
                ));
@@ -1004,7 +1015,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      void
         */
        public final function setSocketResource ($socketResource) {
         * @return      void
         */
        public final function setSocketResource ($socketResource) {
-               //* NOISY-DEBUG: */ $this->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource=' . $socketResource . ',previous[' . gettype($this->socketResource) . ']=' . $this->socketResource);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource=' . $socketResource . ',previous[' . gettype($this->socketResource) . ']=' . $this->socketResource);
                $this->socketResource = $socketResource;
        }
 
                $this->socketResource = $socketResource;
        }
 
@@ -1014,7 +1025,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $socketResource         A valid socket resource
         */
        public final function getSocketResource () {
         * @return      $socketResource         A valid socket resource
         */
        public final function getSocketResource () {
-               //* NOISY-DEBUG: */ $this->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource[' . gettype($this->socketResource) . ']=' . $this->socketResource);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource[' . gettype($this->socketResource) . ']=' . $this->socketResource);
                return $this->socketResource;
        }
 
                return $this->socketResource;
        }
 
@@ -1361,7 +1372,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Debug instance is there?
                if (!is_null($this->getDebugInstance())) {
                        // Output stub message
                // Debug instance is there?
                if (!is_null($this->getDebugInstance())) {
                        // Output stub message
-                       $this->debugOutput($stubMessage);
+                       self::createDebugInstance(__CLASS__)->debugOutput($stubMessage);
                } else {
                        // Trigger an error
                        trigger_error($stubMessage);
                } else {
                        // Trigger an error
                        trigger_error($stubMessage);
@@ -1392,6 +1403,32 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
        }
 
                } // END - if
        }
 
+       /**
+        * Creates an instance of a debugger instance
+        *
+        * @param       $className              Name of the class (currently unsupported)
+        * @return      $debugInstance  An instance of a debugger class
+        */
+       public final static function createDebugInstance ($className) {
+               // Init debug instance
+               $debugInstance = NULL;
+
+               // Try it
+               try {
+                       // Get a debugger instance
+                       $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_class'));
+               } catch (NullPointerException $e) {
+                       // Didn't work, no instance there
+                       die('Cannot create debugInstance! Exception=' . $e->__toString() . ', message=' . $e->getMessage());
+               }
+
+               // Empty string should be ignored and used for testing the middleware
+               DebugMiddleware::getSelfInstance()->output('');
+
+               // Return it
+               return $debugInstance;
+       }
+
        /**
         * Outputs a debug message whether to debug instance (should be set!) or
         * dies with or ptints the message. Do NEVER EVER rewrite the die() call to
        /**
         * Outputs a debug message whether to debug instance (should be set!) or
         * dies with or ptints the message. Do NEVER EVER rewrite the die() call to
@@ -1636,7 +1673,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                // Get current array
                $fieldArray = $resultInstance->current();
 
                // Get current array
                $fieldArray = $resultInstance->current();
-               //* DEBUG: */ $this->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
 
                // Convert dashes to underscore
                $fieldName = $this->convertDashesToUnderscores($fieldName);
 
                // Convert dashes to underscore
                $fieldName = $this->convertDashesToUnderscores($fieldName);
@@ -1647,7 +1684,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $fieldValue = $fieldArray[$fieldName];
                } else {
                        // Missing field entry, may require debugging
                        $fieldValue = $fieldArray[$fieldName];
                } else {
                        // Missing field entry, may require debugging
-                       $this->debugOutput($this->__toString() . ':fieldname=' . $fieldName . ' not found!');
+                       self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . ':fieldname=' . $fieldName . ' not found!');
                }
 
                // Return it
                }
 
                // Return it
@@ -1689,7 +1726,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Debug instance is there?
                        if (!is_null($this->getDebugInstance())) {
                                // Output stub message
                        // Debug instance is there?
                        if (!is_null($this->getDebugInstance())) {
                                // Output stub message
-                               $this->debugOutput($message);
+                               self::createDebugInstance(__CLASS__)->debugOutput($message);
                        } else {
                                // Trigger an error
                                trigger_error($message . "<br />\n");
                        } else {
                                // Trigger an error
                                trigger_error($message . "<br />\n");
@@ -1874,7 +1911,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected function hex2asc ($hex) {
                // Check for length, it must be devideable by 2
         */
        protected function hex2asc ($hex) {
                // Check for length, it must be devideable by 2
-               //* DEBUG: */ $this->debugOutput('hex='.$hex);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('hex='.$hex);
                assert((strlen($hex) % 2) == 0);
 
                // Walk the string
                assert((strlen($hex) % 2) == 0);
 
                // Walk the string
@@ -1916,7 +1953,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                        // Cut it a little down
                        $prepend = substr($prepend, 0, $diff);
 
                        // Cut it a little down
                        $prepend = substr($prepend, 0, $diff);
-                       //* DEBUG: */ $this->debugOutput('prepend('.strlen($prepend).')='.$prepend.',diff='.$diff.',length='.$length);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('prepend('.strlen($prepend).')='.$prepend.',diff='.$diff.',length='.$length);
 
                        // Construct the final prepended string
                        $strFinal = $prepend . $str;
 
                        // Construct the final prepended string
                        $strFinal = $prepend . $str;
@@ -1974,7 +2011,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                );
 
                // And return it
                );
 
                // And return it
-               //* NOISY-DEBUG: */ $this->debugOutput($this->__toString() . ': cacheKey=' . $cacheKey);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . ': cacheKey=' . $cacheKey);
                return $cacheKey;
        }
 
                return $cacheKey;
        }
 
index 6e9fb8440a8aa7c353a0695d1dd491488922973a..364838f06a1c1f52d455b2b96b7e1c4409620b08 100644 (file)
@@ -55,7 +55,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
         * BZIP2 compression stream
         *
         * @param       $streamData             Mixed non-object stream data
         * BZIP2 compression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The compressed stream data      
+        * @return      $streamData             The compressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
@@ -72,7 +72,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
         * BZIP2 decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
         * BZIP2 decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The decompressed stream data    
+        * @return      $streamData             The decompressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
@@ -81,8 +81,11 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
                        throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
                } // END - if
 
                        throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
                } // END - if
 
+               // Decompress it
+               $streamData = bzdecompress($streamData, true);
+
                // Return the decompressed stream
                // Return the decompressed stream
-               return bzdecompress($streamData);
+               return $streamData;
        }
 
        /**
        }
 
        /**
index 2373d78b1a0c7ae70f5c70632b450a5007295d3f..2f6275b8d145740c2a88614393b7a6e682024a78 100644 (file)
@@ -55,7 +55,7 @@ class GzipCompressor extends BaseFrameworkSystem implements Compressor {
         * GZIP compression stream
         *
         * @param       $streamData             Mixed non-object stream data
         * GZIP compression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The compressed stream data      
+        * @return      $streamData             The compressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
@@ -72,7 +72,7 @@ class GzipCompressor extends BaseFrameworkSystem implements Compressor {
         * GZIP decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
         * GZIP decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The decompressed stream data    
+        * @return      $streamData             The decompressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
index 8d03927464949f5c50e394f0670cb2c08dda7b4c..4417255ab9b8ff2047b7a8fc20dc0711348e6110 100644 (file)
@@ -49,7 +49,7 @@ class NullCompressor extends BaseFrameworkSystem implements Compressor {
         * Null compression stream
         *
         * @param       $streamData             Mixed non-object stream data
         * Null compression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The compressed stream data      
+        * @return      $streamData             The compressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
@@ -66,7 +66,7 @@ class NullCompressor extends BaseFrameworkSystem implements Compressor {
         * Null decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
         * Null decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The decompressed stream data    
+        * @return      $streamData             The decompressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
index 742d5ccada114b6a9bcd0254281c06edd5c58011..1fab637765e1979984795cee70f45eb6732b3d25 100644 (file)
@@ -55,7 +55,7 @@ class ZlibCompressor extends BaseFrameworkSystem implements Compressor {
         * ZLIB compression stream
         *
         * @param       $streamData             Mixed non-object stream data
         * ZLIB compression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The compressed stream data      
+        * @return      $streamData             The compressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
@@ -72,7 +72,7 @@ class ZlibCompressor extends BaseFrameworkSystem implements Compressor {
         * ZLIB decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
         * ZLIB decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The decompressed stream data    
+        * @return      $streamData             The decompressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
index b82eb19e5e42fd5f3db63dc0a7377a07daaee9ee..960aaa42a926fcd412721eb60d6b32560f5a0046 100644 (file)
@@ -46,7 +46,7 @@ class ConsoleTools extends BaseFrameworkSystem {
         */
        protected function resolveIpAddress ($hostname) {
                // Debug message
         */
        protected function resolveIpAddress ($hostname) {
                // Debug message
-               $this->debugOutput(sprintf('[%s:] Host name to resolve is: %s',
+               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] Host name to resolve is: %s',
                        $this->__toString(),
                        $hostname
                ));
                        $this->__toString(),
                        $hostname
                ));
@@ -64,13 +64,13 @@ class ConsoleTools extends BaseFrameworkSystem {
                        $ip = $ipResolved;
 
                        // Debug message
                        $ip = $ipResolved;
 
                        // Debug message
-                       $this->debugOutput(sprintf('[%s:] Resolved IP address is: %s',
+                       self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] Resolved IP address is: %s',
                                $this->__toString(),
                                $ip
                        ));
                } else {
                        // Problem while resolving IP address
                                $this->__toString(),
                                $ip
                        ));
                } else {
                        // Problem while resolving IP address
-                       $this->debugOutput(sprintf('[%s:] Problem resolving IP address for host %s. Please check your /etc/hosts file.',
+                       self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] Problem resolving IP address for host %s. Please check your /etc/hosts file.',
                                $this->__toString(),
                                $hostname
                        ));
                                $this->__toString(),
                                $hostname
                        ));
@@ -123,7 +123,7 @@ class ConsoleTools extends BaseFrameworkSystem {
 
                // Add last new-line
                $proxyTunnel .= self::HTTP_EOL;
 
                // Add last new-line
                $proxyTunnel .= self::HTTP_EOL;
-               //* DEBUG: */ $this->debugOutput('CONSOLE-TOOLS: proxyTunnel=' . $proxyTunnel);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONSOLE-TOOLS: proxyTunnel=' . $proxyTunnel);
 
                // Write request
                fwrite($socketResource, $proxyTunnel);
 
                // Write request
                fwrite($socketResource, $proxyTunnel);
index d7bb080ebac48a721453b68aaf806718d1d5c0ea..13dbfb4cf344d78c3677a23a105e51f0cd9dd1b5 100644 (file)
@@ -75,7 +75,7 @@ class SocketContainer extends BaseContainer implements Registerable {
                $packageData = $this->getPackageData();
 
                // Debug message
                $packageData = $this->getPackageData();
 
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput('SOCKET-CONTAINER: addressPort=' . $addressPort . ',packageData=' . print_r($packageData, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER: addressPort=' . $addressPort . ',packageData=' . print_r($packageData, true));
 
                // So, does both match?
                $matches = ((isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) && ($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] === $addressPort));
 
                // So, does both match?
                $matches = ((isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) && ($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] === $addressPort));
@@ -92,7 +92,7 @@ class SocketContainer extends BaseContainer implements Registerable {
         */
        public final function ifSocketResourceMatches ($socketResource) {
                // Debug message
         */
        public final function ifSocketResourceMatches ($socketResource) {
                // Debug message
-               /* NOISY-DEBUG: */ $this->debugOutput('SOCKET-CONTAINER: socketResource[' . gettype($socketResource) . ']=' .$socketResource . ',storedResource[' . gettype($this->getSocketResource()) . ']=' . $this->getSocketResource());
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER: socketResource[' . gettype($socketResource) . ']=' .$socketResource . ',storedResource[' . gettype($this->getSocketResource()) . ']=' . $this->getSocketResource());
 
                // So, does both match?
                $matches = ((is_resource($socketResource)) && ($socketResource === $this->getSocketResource()));
 
                // So, does both match?
                $matches = ((is_resource($socketResource)) && ($socketResource === $this->getSocketResource()));
index c7dfa8973ef51c45b887812d435991b05190ce4c..28c8de1bc54b0249abb7ca80b676ef4d5105ba38 100644 (file)
@@ -61,9 +61,9 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
         * @return      void
         */
        protected function initFilterChain ($filterChain) {
         * @return      void
         */
        protected function initFilterChain ($filterChain) {
-               //* DEBUG: */ $this->debugOutput('CONTROLLER: ' . $filterChain . ' init: START');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: START');
                $this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
                $this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
-               //* DEBUG: */ $this->debugOutput('CONTROLLER: ' . $filterChain . ' init: FINISHED');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: FINISHED');
        }
 
        /**
        }
 
        /**
@@ -75,7 +75,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
         * @throws      InvalidFilterChainException     If the filter chain is invalid
         */
        protected function addFilter ($filterChain, Filterable $filterInstance) {
         * @throws      InvalidFilterChainException     If the filter chain is invalid
         */
        protected function addFilter ($filterChain, Filterable $filterInstance) {
-               //* DEBUG: */ $this->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: START');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: START');
 
                // Test if the filter is there
                if (!isset($this->filterChains[$filterChain])) {
 
                // Test if the filter is there
                if (!isset($this->filterChains[$filterChain])) {
@@ -85,7 +85,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
 
                // Add the filter
                $this->filterChains[$filterChain]->addFilter($filterInstance);
 
                // Add the filter
                $this->filterChains[$filterChain]->addFilter($filterInstance);
-               //* DEBUG: */ $this->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: FINISH');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: FINISH');
        }
 
        /**
        }
 
        /**
index e1c048c538f807847927fd13d1088d2f45155e98..582a696b9b18e3cb583d61bccad22f12ac465ebd 100644 (file)
@@ -106,7 +106,7 @@ class BaseCriteria extends BaseFrameworkSystem {
                $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
 
                // Debug message
                $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
 
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput('CRITERIA: criteriaKey=' . $criteriaKey . ',criteria()=' . count($this->criteria));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRITERIA: criteriaKey=' . $criteriaKey . ',criteria()=' . count($this->criteria));
 
                // Default is not found
                $value = NULL;
 
                // Default is not found
                $value = NULL;
index 31a63a39d3d162a36db6066965bafbde4a5cb4cb..357be67706a1072528f2d63e4c2feb58cb84fb8c 100644 (file)
@@ -84,7 +84,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
        protected function queryInsertDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) {
                // First get a key suitable for our cache and extend it with this class name
                $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
        protected function queryInsertDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) {
                // First get a key suitable for our cache and extend it with this class name
                $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
-               //* DEBUG: */ $this->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
 
                // Does this key exists in cache?
                if ($this->cacheInstance->offsetExists($cacheKey)) {
 
                // Does this key exists in cache?
                if ($this->cacheInstance->offsetExists($cacheKey)) {
@@ -106,7 +106,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
        protected function queryUpdateDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) {
                // First get a key suitable for our cache and extend it with this class name
                $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
        protected function queryUpdateDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) {
                // First get a key suitable for our cache and extend it with this class name
                $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
-               //* DEBUG: */ $this->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
 
                // Does this key exists in cache?
                if ($this->cacheInstance->offsetExists($cacheKey)) {
 
                // Does this key exists in cache?
                if ($this->cacheInstance->offsetExists($cacheKey)) {
@@ -151,13 +151,13 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                // Does this key exists in cache?
                if ($this->cacheInstance->offsetExists($cacheKey)) {
                        // Debug message
                // Does this key exists in cache?
                if ($this->cacheInstance->offsetExists($cacheKey)) {
                        // Debug message
-                       //* DEBUG: */ $this->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey);
 
                        // Then use this result
                        $result = $this->cacheInstance->offsetGet($cacheKey);
                } else {
                        // Debug message
 
                        // Then use this result
                        $result = $this->cacheInstance->offsetGet($cacheKey);
                } else {
                        // Debug message
-                       //* DEBUG: */ $this->debugOutput('BASE-WRAPPER: Quering database, cacheKey=' . $cacheKey);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Quering database, cacheKey=' . $cacheKey);
 
                        // Now it's time to ask the database layer for this select statement
                        $result = $this->getDatabaseInstance()->doSelectByTableCriteria($this->getTableName(), $criteriaInstance);
 
                        // Now it's time to ask the database layer for this select statement
                        $result = $this->getDatabaseInstance()->doSelectByTableCriteria($this->getTableName(), $criteriaInstance);
@@ -202,7 +202,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                        $numRows = $resultInstance->getAffectedRows();
 
                        // Debug message
                        $numRows = $resultInstance->getAffectedRows();
 
                        // Debug message
-                       //* DEBUG: */ $this->debugOutput('BASE-WRAPPER: numRows=' . $numRows);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: numRows=' . $numRows);
                } // END - if
 
                // Return the result
                } // END - if
 
                // Return the result
index d92c29b41d940278c3ce1df9be1abb67cdd80f7a..375ec98ece9a00742edf85e71ba7e241d9d027d2 100644 (file)
@@ -89,6 +89,12 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                // Set the compressor channel
                $databaseInstance->setCompressorChannel($compressorInstance);
 
                // Set the compressor channel
                $databaseInstance->setCompressorChannel($compressorInstance);
 
+               // Get a file IO handler
+               $fileIoInstance = ObjectFactory::createObjectByConfiguredName('file_io_class');
+
+               // ... and set it
+               $databaseInstance->setFileIoInstance($fileIoInstance);
+
                // "Connect" to the database
                $databaseInstance->connectToDatabase();
 
                // "Connect" to the database
                $databaseInstance->connectToDatabase();
 
@@ -162,16 +168,13 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
         */
        private function getDataArrayFromFile ($fqfn) {
                // Debug message
         */
        private function getDataArrayFromFile ($fqfn) {
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput('DATABASE: Reading elements from database file ' . $fqfn . ' ...');
-
-               // Get a file pointer
-               $fileInstance = FrameworkFileInputPointer::createFrameworkFileInputPointer($fqfn);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Reading elements from database file ' . $fqfn . ' ...');
 
 
-               // Get the raw data and BASE64-decode it
-               $compressedData = base64_decode($fileInstance->readLinesFromFile());
+               // Init compressed data
+               $compressedData = $this->getFileIoInstance()->loadFileContents($fqfn);
+               $compressedData = $compressedData['data'];
 
                // Close the file and throw the instance away
 
                // Close the file and throw the instance away
-               $fileInstance->closeFile();
                unset($fileInstance);
 
                // Decompress it
                unset($fileInstance);
 
                // Decompress it
@@ -181,7 +184,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                $dataArray = unserialize($serializedData);
 
                // Debug message
                $dataArray = unserialize($serializedData);
 
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput('DATABASE: Read ' . count($dataArray) . ' elements from database file ' . $fqfn . '.');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Read ' . count($dataArray) . ' elements from database file ' . $fqfn . '.');
 
                // Finally return it
                return $dataArray;
 
                // Finally return it
                return $dataArray;
@@ -196,22 +199,19 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
         */
        private function writeDataArrayToFqfn ($fqfn, array $dataArray) {
                // Debug message
         */
        private function writeDataArrayToFqfn ($fqfn, array $dataArray) {
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file ' . $fqfn . ' ...');
-
-               // Get a file pointer instance
-               $fileInstance = FrameworkFileOutputPointer::createFrameworkFileOutputPointer($fqfn, 'w');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file ' . $fqfn . ' ...');
 
                // Serialize and compress it
                $compressedData = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($dataArray));
 
 
                // Serialize and compress it
                $compressedData = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($dataArray));
 
-               // Write this data BASE64 encoded to the file
-               $fileInstance->writeToFile(base64_encode($compressedData));
+               // Write data
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Writing ' . strlen($compressedData) . ' bytes ...');
 
 
-               // Close the file pointer
-               $fileInstance->closeFile();
+               // Write this data BASE64 encoded to the file
+               $this->getFileIoInstance()->saveFile($fqfn, $compressedData);
 
                // Debug message
 
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file completed.');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file completed.');
        }
 
        /**
        }
 
        /**
@@ -350,6 +350,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
 
                                // Read the file
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
 
                                // Read the file
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray,true));
 
                                // Is this an array?
                                if (is_array($dataArray)) {
 
                                // Is this an array?
                                if (is_array($dataArray)) {
@@ -359,7 +360,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                                                $criteria = $criteriaInstance->getCriteriaElemnent($key);
 
                                                // Is the criteria met or none set?
                                                $criteria = $criteriaInstance->getCriteriaElemnent($key);
 
                                                // Is the criteria met or none set?
-                                               //* NOISY-DEBUG: */ $this->debugOutput('DATABASE: criteria[' . gettype($criteria) . ']=' . $criteria . ';()=' . strlen($criteria) . ',criteriaInstance()=' . $criteriaInstance->count() . ',value(' . strlen($value) . ')=' . $value);
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: criteria[' . gettype($criteria) . ']=' . $criteria . ';()=' . strlen($criteria) . ',criteriaInstance()=' . $criteriaInstance->count() . ',value(' . strlen($value) . ')=' . $value);
                                                if (((!is_null($criteria)) && ($criteria == $value)) || ($criteriaInstance->count() == 0))  {
                                                        // Shall we skip this entry?
                                                        if ($criteriaInstance->getSkip() > 0) {
                                                if (((!is_null($criteria)) && ($criteria == $value)) || ($criteriaInstance->count() == 0))  {
                                                        // Shall we skip this entry?
                                                        if ($criteriaInstance->getSkip() > 0) {
@@ -375,7 +376,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                                                        $dataArray[$this->getIndexKey()] = $idx;
 
                                                        // Entry found!
                                                        $dataArray[$this->getIndexKey()] = $idx;
 
                                                        // Entry found!
-                                                       //* NOISY-DEBUG: */ $this->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, true));
+                                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, true));
                                                        $resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS][] = $dataArray;
 
                                                        // Count found entries up
                                                        $resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS][] = $dataArray;
 
                                                        // Count found entries up
@@ -474,13 +475,14 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                                // Does the extension match?
                                if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) {
                                        // Debug message
                                // Does the extension match?
                                if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) {
                                        // Debug message
-                                       /* NOISY-DEBUG: */ $this->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension());
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!');
                                        // Skip this file!
                                        continue;
                                } // END - if
 
                                // Open this file for reading
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
                                        // Skip this file!
                                        continue;
                                } // END - if
 
                                // Open this file for reading
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray,true));
 
                                // Is this an array?
                                if (is_array($dataArray)) {
 
                                // Is this an array?
                                if (is_array($dataArray)) {
@@ -488,6 +490,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
                                        foreach ($dataArray as $key => $value) {
                                                // Get criteria element
                                                $criteria = $searchInstance->getCriteriaElemnent($key);
                                        foreach ($dataArray as $key => $value) {
                                                // Get criteria element
                                                $criteria = $searchInstance->getCriteriaElemnent($key);
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',key=' . $key . ',criteria=' . $criteria);
 
                                                // Is the criteria met?
                                                if (((!is_null($criteria)) && ($criteria == $value)) || ($searchInstance->count() == 0))  {
 
                                                // Is the criteria met?
                                                if (((!is_null($criteria)) && ($criteria == $value)) || ($searchInstance->count() == 0))  {
@@ -503,6 +506,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
 
                                                        // Entry found, so update it
                                                        foreach ($criteriaArray as $criteriaKey => $criteriaValue) {
 
                                                        // Entry found, so update it
                                                        foreach ($criteriaArray as $criteriaKey => $criteriaValue) {
+                                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
                                                                $dataArray[$criteriaKey] = $criteriaValue;
                                                        } // END - foreach
 
                                                                $dataArray[$criteriaKey] = $criteriaValue;
                                                        } // END - foreach
 
index 16e8dfa80435ad8ec351be442f000f655b5d5706..ed74c51394d52f67270e3d6cfda34e431d75fb51 100644 (file)
@@ -94,7 +94,7 @@ class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, Output
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData ($data) {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData ($data) {
-               $this->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+               self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
index 22fe5598f367ccf81e1f1bfd8f2b26d1c83f6670..2baf7917cd398858847e1814b1a5bb4623682843 100644 (file)
@@ -91,7 +91,7 @@ class DebugErrorLogOutput extends BaseFrameworkSystem implements Debugger, Outpu
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData ($data) {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData ($data) {
-               $this->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+               self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
index 2d931db4da476a042dcda8408a6591f4f94de57e..cfa8788aa70fb58812a86612feb7d4e45db9298c 100644 (file)
@@ -80,7 +80,7 @@ class DebugWebOutput extends BaseFrameworkSystem implements Debugger, OutputStre
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData ($data) {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData ($data) {
-               $this->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+               self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
index 0dc1353081f4328cd7da8cb26bb7b7616d51b369..b6309baa55ddbda99fa772f89b5c4d57a9722c64 100644 (file)
@@ -70,6 +70,12 @@ class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Regis
                // Get result back
                $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
 
                // Get result back
                $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
 
+               // Advanced to next entry
+               if (!$resultInstance->next()) {
+                       // Not valid!
+                       assert(false);
+               } // END - if
+
                // Set the result instance
                $this->setResultInstance($resultInstance);
        }
                // Set the result instance
                $this->setResultInstance($resultInstance);
        }
index afa63ab7584b92679352e9643f67b456733ea097..3aff6387bed5393f1ab557f7dba27159c4d4e827 100644 (file)
@@ -78,16 +78,16 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
         */
        public function processFilters (Requestable $requestInstance, Responseable $responseInstance) {
                // Run all filters
         */
        public function processFilters (Requestable $requestInstance, Responseable $responseInstance) {
                // Run all filters
-               //* DEBUG */ $this->debugOutput('COUNT=' . count($this->filters));
+               //* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('COUNT=' . count($this->filters));
                foreach ($this->getFilters() as $filterInstance) {
                        // Try to execute this filter
                        try {
                foreach ($this->getFilters() as $filterInstance) {
                        // Try to execute this filter
                        try {
-                               //* DEBUG */ $this->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing started.');
+                               //* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing started.');
                                $filterInstance->execute($requestInstance, $responseInstance);
                                $filterInstance->execute($requestInstance, $responseInstance);
-                               //* DEBUG */ $this->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing ended.');
+                               //* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing ended.');
                        } catch (FilterChainException $e) {
                                // This exception can be thrown to just skip any further processing
                        } catch (FilterChainException $e) {
                                // This exception can be thrown to just skip any further processing
-                               $this->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage());
+                               self::createDebugInstance(__CLASS__)->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage());
                                break;
                        }
                } // END - foreach
                                break;
                        }
                } // END - foreach
index e8d757028ff96662ef753c88160293d02171c716..172846a9cea2d3c2faf44ed250bbd6f136620b10 100644 (file)
@@ -175,7 +175,7 @@ class BaseHelper extends BaseFrameworkSystem {
        public function assignFieldWithFilter ($fieldName, $filterMethod) {
                // Get the value
                $fieldValue = $this->getValueField($fieldName);
        public function assignFieldWithFilter ($fieldName, $filterMethod) {
                // Get the value
                $fieldValue = $this->getValueField($fieldName);
-               //* DEBUG: */ $this->debugOutput($fieldName.'='.$fieldValue);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'='.$fieldValue);
 
                // Now filter it through the value through the filter method
                $filteredValue = call_user_func_array(array($this, 'doFilter' . $this->convertToClassName($filterMethod)), array($fieldValue));
 
                // Now filter it through the value through the filter method
                $filteredValue = call_user_func_array(array($this, 'doFilter' . $this->convertToClassName($filterMethod)), array($fieldValue));
@@ -193,14 +193,14 @@ class BaseHelper extends BaseFrameworkSystem {
         * @throws      NullPointerException    If recovery of requested value instance failed
         */
        public function prefetchValueInstance ($registryKey, $extraKey = NULL) {
         * @throws      NullPointerException    If recovery of requested value instance failed
         */
        public function prefetchValueInstance ($registryKey, $extraKey = NULL) {
-               //* DEBUG: */ $this->debugOutput('O:'.$registryKey.'/'.$extraKey);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('O:'.$registryKey.'/'.$extraKey);
                try {
                        // Get the required instance
                        $this->valueInstance = Registry::getRegistry()->getInstance($registryKey);
                } catch (NullPointerException $e) {
                        // Not set in registry
                        // @TODO Try to log it here
                try {
                        // Get the required instance
                        $this->valueInstance = Registry::getRegistry()->getInstance($registryKey);
                } catch (NullPointerException $e) {
                        // Not set in registry
                        // @TODO Try to log it here
-                       //* DEBUG: */ $this->debugOutput($registryKey.'=NULL!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($registryKey.'=NULL!');
                }
 
                // Shall we get an extra instance?
                }
 
                // Shall we get an extra instance?
@@ -212,7 +212,7 @@ class BaseHelper extends BaseFrameworkSystem {
                                // Try to create it
                                $this->extraInstance = ObjectFactory::createObjectByConfiguredName($extraKey . '_class', array($this->valueInstance));
                        }
                                // Try to create it
                                $this->extraInstance = ObjectFactory::createObjectByConfiguredName($extraKey . '_class', array($this->valueInstance));
                        }
-                       //* DEBUG: */ $this->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!');
                } // END - if
 
                // Is the value instance valid?
                } // END - if
 
                // Is the value instance valid?
@@ -457,7 +457,7 @@ class BaseHelper extends BaseFrameworkSystem {
 
                // Get the field value
                $fieldValue = $this->getValueInstance()->getField($fieldName);
 
                // Get the field value
                $fieldValue = $this->getValueInstance()->getField($fieldName);
-               //* DEBUG: */ $this->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).')');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).')');
 
                // Is it null?
                if ((is_null($fieldValue)) && (!is_null($this->extraInstance))) {
 
                // Is it null?
                if ((is_null($fieldValue)) && (!is_null($this->extraInstance))) {
index 2ce19c611a7f6eaa1612200cc4e5f761c92fa624..d8ed3515879f7a60676d77152a265d5ee793e5e1 100644 (file)
@@ -73,7 +73,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         * @see         FileOutputStreamer
         * @todo        This method needs heavy rewrite
         */
         * @see         FileOutputStreamer
         * @todo        This method needs heavy rewrite
         */
-       public final function saveFile ($fileName, $dataArray) {
+       public final function saveFile ($fileName, array $dataArray) {
                // Try it five times
                $dirName = ''; $fileInstance = NULL;
                for ($idx = 0; $idx < 5; $idx++) {
                // Try it five times
                $dirName = ''; $fileInstance = NULL;
                for ($idx = 0; $idx < 5; $idx++) {
@@ -255,7 +255,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData ($data) {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function streamData ($data) {
-               $this->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+               self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
index 3ce6a8175b4fe4430ae45a8fe5923ae4cd9f6c68..f48b884b2112a7e94d155cfc273d56b3e1fadb2a 100644 (file)
@@ -140,7 +140,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
        public function readDirectoryExcept (array $except = array('.', '..')) {
                if (count($except) == 0) {
                        // No exception given, so read all data
        public function readDirectoryExcept (array $except = array('.', '..')) {
                if (count($except) == 0) {
                        // No exception given, so read all data
-                       $this->debugOutput('DIRECTORY: No exceptions given, please use readRawDirectory() instead!');
+                       self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY: No exceptions given, please use readRawDirectory() instead!');
                        return $this->readRawDirectory();
                } // END - if
 
                        return $this->readRawDirectory();
                } // END - if
 
@@ -150,16 +150,16 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
                // Shall we exclude directories?
                if ((!is_null($rawLine)) && ($rawLine !== false) && (!in_array($rawLine, $except))) {
                        // Return read data
                // Shall we exclude directories?
                if ((!is_null($rawLine)) && ($rawLine !== false) && (!in_array($rawLine, $except))) {
                        // Return read data
-                       //* NOISY-DEBUG: */ $this->debugOutput('DIRECTORY: rawLine[' . gettype($rawLine) . ']=' . $rawLine);
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY: rawLine[' . gettype($rawLine) . ']=' . $rawLine);
                        return $rawLine;
                } elseif ((!is_null($rawLine)) && ($rawLine !== false)) {
                        // Exclude this part
                        return $rawLine;
                } elseif ((!is_null($rawLine)) && ($rawLine !== false)) {
                        // Exclude this part
-                       //* NOISY-DEBUG: */ $this->debugOutput('DIRECTORY: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!');
                        return $this->readDirectoryExcept($except);
                }
 
                // End pointer reached
                        return $this->readDirectoryExcept($except);
                }
 
                // End pointer reached
-               //* NOISY-DEBUG: */ $this->debugOutput('DIRECTORY: Returning NULL!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY: Returning NULL!');
                return NULL;
        }
 
                return NULL;
        }
 
index a6ccca4e7220cc2293eef29f496dd232fe739d69..14eab16efb9436c2764280dfd8bbfc8bebde7704 100644 (file)
@@ -81,7 +81,7 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem {
                }
 
                // Try to open a handler
                }
 
                // Try to open a handler
-               $filePointer = @fopen($fileName, 'rb');
+               $filePointer = fopen($fileName, 'rb');
                if ((is_null($filePointer)) || ($filePointer === false)) {
                        // Something bad happend
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
                if ((is_null($filePointer)) || ($filePointer === false)) {
                        // Something bad happend
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
@@ -120,28 +120,6 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem {
                return fread($this->getPointer(), 1024);
        }
 
                return fread($this->getPointer(), 1024);
        }
 
-       /**
-        * Read lines from a file pointer
-        *
-        * @return      mixed   The result of fread()
-        * @throws      NullPointerException    If the file pointer instance
-        *                                                                      is not set by setPointer()
-        * @throws      InvalidResourceException        If there is being set
-        *                                                                      an invalid file resource
-        */
-       public function readLinesFromFile () {
-               if (is_null($this->getPointer())) {
-                       // Pointer not initialized
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_resource($this->getPointer())) {
-                       // Pointer is not a valid resource!
-                       throw new InvalidResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER);
-               }
-
-               // Read data from the file pointer and return it
-               return fgets($this->getPointer(), 1024);
-       }
-
        /**
         * Close a file source and set it's instance to null and the file name
         * to empty
        /**
         * Close a file source and set it's instance to null and the file name
         * to empty
index 9374dc61259d96845b99ac183c7c0d741c13d43e..3394a85ae13d75faab0acd1316edfa4ab50fb510 100644 (file)
@@ -65,9 +65,9 @@ class XmlParser extends BaseParser implements Parseable {
                // Convert all to UTF8
                if (empty($content)) {
                        // No empty content!
                // Convert all to UTF8
                if (empty($content)) {
                        // No empty content!
-                       $this->debugOutput('Empty content! Backtrace: <pre>');
+                       self::createDebugInstance(__CLASS__)->debugOutput('Empty content! Backtrace: <pre>');
                        debug_print_backtrace();
                        debug_print_backtrace();
-                       $this->debugOutput('</pre>');
+                       self::createDebugInstance(__CLASS__)->debugOutput('</pre>');
                        die();
                } elseif (function_exists('recode')) {
                        // Recode found, so use it
                        die();
                } elseif (function_exists('recode')) {
                        // Recode found, so use it
index a368855c8d0a4a6fa5fae45f9d0fe5d8d1982250..cfe6edbc5403e3db20a6690b9e046868847c464e 100644 (file)
@@ -132,19 +132,19 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
                // "Walk" over all entries
                foreach ($this->getEntries('object-name') as $key => $value) {
                        // Debug message
                // "Walk" over all entries
                foreach ($this->getEntries('object-name') as $key => $value) {
                        // Debug message
-                       //* DEBUG: */ $this->debugOutput('REGISTRY: Checking key=' . $key . ',value=' . $value . ',lookFor=' . $lookFor);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY: Checking key=' . $key . ',value=' . $value . ',lookFor=' . $lookFor);
 
                        // If $value matches the $lookFor, we need to look for more entries for this!
                        if ($lookFor == $value) {
                                // Look for more entries
                                foreach ($this->getEntries() as $key2 => $value2) {
                                        // Debug message
 
                        // If $value matches the $lookFor, we need to look for more entries for this!
                        if ($lookFor == $value) {
                                // Look for more entries
                                foreach ($this->getEntries() as $key2 => $value2) {
                                        // Debug message
-                                       //* DEBUG: */ $this->debugOutput('REGISTRY: Checking key2=' . $key2 . ',value2=' . print_r($value2, true) . ',lookFor=' . $lookFor);
+                                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY: Checking key2=' . $key2 . ',value2=' . print_r($value2, true) . ',lookFor=' . $lookFor);
 
                                        // Both keys must match!
                                        if (($key == $key2) || (isset($value2[$key]))) {
                                                // Debug message
 
                                        // Both keys must match!
                                        if (($key == $key2) || (isset($value2[$key]))) {
                                                // Debug message
-                                               //* DEBUG: */ $this->debugOutput('REGISTRY: Adding ' . $value2[$key] . ' ...');
+                                               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY: Adding ' . $value2[$key] . ' ...');
 
                                                // Then add it
                                                $entry[$key2] = $value2[$key];
 
                                                // Then add it
                                                $entry[$key2] = $value2[$key];
index f7513385641e30e0d0d067f9ba87d35c37f68d2a..69fcf8700793fa4dfe55298f43ec050e267e298c 100644 (file)
@@ -78,7 +78,7 @@ class BaseControllerResolver extends BaseResolver {
                $this->setClassName($this->getClassPrefix() . 'DefaultNewsController');
 
                // Generate the class name
                $this->setClassName($this->getClassPrefix() . 'DefaultNewsController');
 
                // Generate the class name
-               //* DEBUG: */ $this->debugOutput('BEFORE: controller=' . $controllerName);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BEFORE: controller=' . $controllerName);
                if ($controllerName != $defaultController) {
                        // Create controller class name
                        $className = $this->getClassPrefix() . $this->convertToClassName($controllerName) . 'Controller';
                if ($controllerName != $defaultController) {
                        // Create controller class name
                        $className = $this->getClassPrefix() . $this->convertToClassName($controllerName) . 'Controller';
@@ -89,7 +89,7 @@ class BaseControllerResolver extends BaseResolver {
                        // No news at main command or non-news command
                        $this->setClassName($this->getClassPrefix() . 'DefaultNewsController');
                }
                        // No news at main command or non-news command
                        $this->setClassName($this->getClassPrefix() . 'DefaultNewsController');
                }
-               //* DEBUG: */ $this->debugOutput('AFTER: controller=' . $this->getClassName());
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('AFTER: controller=' . $this->getClassName());
 
                // Is this class loaded?
                if (!class_exists($this->getClassName())) {
 
                // Is this class loaded?
                if (!class_exists($this->getClassName())) {
index 80615f314ef1473abe2605311973c51546b714f5..c8cfa4f510c80fac7008de0268f623fe04555bda 100644 (file)
@@ -171,7 +171,7 @@ class BaseResponse extends BaseFrameworkSystem {
                        // Send all headers
                        foreach ($this->responseHeaders as $name => $value) {
                                header($name . ': ' . $value);
                        // Send all headers
                        foreach ($this->responseHeaders as $name => $value) {
                                header($name . ': ' . $value);
-                               //* DEBUG: */ $this->debugOutput('name=' . $name . ',value=' . $value);
+                               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('name=' . $name . ',value=' . $value);
                        } // END - foreach
 
                        // Send cookies out?
                        } // END - foreach
 
                        // Send cookies out?
index 4607bd4c9bc722cddcc48aa24b08b3d8a1495330..7f6f1e9ef0afb50ee92c910e70cf2b4933c5ee97 100644 (file)
@@ -163,7 +163,7 @@ class McryptStream extends BaseStream implements EncryptableStream {
         * @throws      UnsupportedOperationException   If this method is called (which is a mistake)
         */
        public function streamData ($data) {
         * @throws      UnsupportedOperationException   If this method is called (which is a mistake)
         */
        public function streamData ($data) {
-               $this->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+               self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
index a8fb9ecdca1bf127cd92cebaf532066e4dd49e1b..25372a9944ee49e1173737b3ee99ac82bf84f563 100644 (file)
@@ -82,7 +82,7 @@ class NullCryptoStream extends BaseStream implements EncryptableStream {
         * @throws      UnsupportedOperationException   If this method is called (which is a mistake)
         */
        public function streamData ($data) {
         * @throws      UnsupportedOperationException   If this method is called (which is a mistake)
         */
        public function streamData ($data) {
-               $this->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+               self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }
index 334ff102e899e7fae1ed29f665493effc436019e..2692af52db42daf6505fcf1e8c4f264e53c98c3e 100644 (file)
@@ -181,7 +181,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // If the stack is null, use the current group
                if (is_null($stack)) {
                        // Use current group
                // If the stack is null, use the current group
                if (is_null($stack)) {
                        // Use current group
-                       //* DEBUG: */ $this->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!');
                        $stack = $this->currGroup;
                } // END - if
 
                        $stack = $this->currGroup;
                } // END - if
 
@@ -189,11 +189,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                if ($this->isVarStackSet($stack)) {
                        // Now search for it
                        foreach ($this->getVarStack($stack) as $index => $currEntry) {
                if ($this->isVarStackSet($stack)) {
                        // Now search for it
                        foreach ($this->getVarStack($stack) as $index => $currEntry) {
-                               //* DEBUG: */ $this->debugOutput(__METHOD__.':currGroup=' . $stack . ',idx=' . $index . ',currEntry=' . $currEntry['name'] . ',variableName=' . $variableName);
+                               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.':currGroup=' . $stack . ',idx=' . $index . ',currEntry=' . $currEntry['name'] . ',variableName=' . $variableName);
                                // Is the entry found?
                                if ($currEntry['name'] == $variableName) {
                                        // Found!
                                // Is the entry found?
                                if ($currEntry['name'] == $variableName) {
                                        // Found!
-                                       //* DEBUG: */ $this->debugOutput(__METHOD__.':FOUND!');
+                                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.':FOUND!');
                                        $found = $index;
                                        break;
                                } // END - if
                                        $found = $index;
                                        break;
                                } // END - if
@@ -256,7 +256,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // If the stack is null, use the current group
                if (is_null($stack)) {
                        // Use current group
                // If the stack is null, use the current group
                if (is_null($stack)) {
                        // Use current group
-                       //* DEBUG: */ $this->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!');
                        $stack = $this->currGroup;
                } // END - if
 
                        $stack = $this->currGroup;
                } // END - if
 
@@ -270,7 +270,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                } // END - if
 
                // Return the current position
                } // END - if
 
                // Return the current position
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': group=' . $stack . ',variableName=' . $variableName . ', content[' . gettype($content) . ']=' . $content);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': group=' . $stack . ',variableName=' . $variableName . ', content[' . gettype($content) . ']=' . $content);
                return $content;
        }
 
                return $content;
        }
 
@@ -317,7 +317,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function setVariableGroup ($groupName, $add = true) {
                // Set group name
         */
        public function setVariableGroup ($groupName, $add = true) {
                // Set group name
-               //* DEBIG: */ $this->debugOutput(__METHOD__.': currGroup=' . $groupName);
+               //* DEBIG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': currGroup=' . $groupName);
                $this->currGroup = $groupName;
 
                // Skip group 'general'
                $this->currGroup = $groupName;
 
                // Skip group 'general'
@@ -339,7 +339,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $variableName = trim($this->convertDashesToUnderscores($variableName));
 
                // Debug message
                $variableName = trim($this->convertDashesToUnderscores($variableName));
 
                // Debug message
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': group=' . $this->currGroup . ', variableName=' . $variableName . ', value=' . $value);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': group=' . $this->currGroup . ', variableName=' . $variableName . ', value=' . $value);
 
                // Get current variables in group
                $currVars = $this->readCurrentGroup();
 
                // Get current variables in group
                $currVars = $this->readCurrentGroup();
@@ -601,11 +601,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Was it found?
                if ($index === false) {
                        // Add it to the stack
                // Was it found?
                if ($index === false) {
                        // Add it to the stack
-                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ':ADD: ' . $variableName . '[' . gettype($value) . ']=' . $value);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':ADD: ' . $variableName . '[' . gettype($value) . ']=' . $value);
                        $this->addVariable($variableName, $value);
                } elseif (!empty($value)) {
                        // Modify the stack entry
                        $this->addVariable($variableName, $value);
                } elseif (!empty($value)) {
                        // Modify the stack entry
-                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ':MOD: ' . $variableName . '[' . gettype($value) . ']=' . $value);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':MOD: ' . $variableName . '[' . gettype($value) . ']=' . $value);
                        $this->modifyVariable($variableName, $value);
                }
        }
                        $this->modifyVariable($variableName, $value);
                }
        }
@@ -652,8 +652,8 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        protected final function setRawTemplateData ($rawTemplateData) {
                // And store it in this class
         */
        protected final function setRawTemplateData ($rawTemplateData) {
                // And store it in this class
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': ' . strlen($rawTemplateData) . ' Bytes set.');
-               //* DEBUG: */ $this->debugOutput(__METHOD__.': ' . $this->currGroup . ' variables: ' . count($this->getVarStack($this->currGroup)) . ', groups=' . count($this->varStack));
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': ' . strlen($rawTemplateData) . ' Bytes set.');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': ' . $this->currGroup . ' variables: ' . count($this->getVarStack($this->currGroup)) . ', groups=' . count($this->varStack));
                $this->rawTemplateData = (string) $rawTemplateData;
        }
 
                $this->rawTemplateData = (string) $rawTemplateData;
        }
 
@@ -663,7 +663,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      $rawTemplateData        The raw data from the template
         */
        public final function getRawTemplateData () {
         * @return      $rawTemplateData        The raw data from the template
         */
        public final function getRawTemplateData () {
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': ' . strlen($this->rawTemplateData) . ' Bytes read.');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': ' . strlen($this->rawTemplateData) . ' Bytes read.');
                return $this->rawTemplateData;
        }
 
                return $this->rawTemplateData;
        }
 
@@ -674,7 +674,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private final function setCompiledData ($compiledData) {
                // And store it in this class
         */
        private final function setCompiledData ($compiledData) {
                // And store it in this class
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': ' . strlen($compiledData) . ' Bytes set.');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': ' . strlen($compiledData) . ' Bytes set.');
                $this->compiledData = (string) $compiledData;
        }
 
                $this->compiledData = (string) $compiledData;
        }
 
@@ -684,7 +684,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      $compiledData   Compiled template data
         */
        public final function getCompiledData () {
         * @return      $compiledData   Compiled template data
         */
        public final function getCompiledData () {
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': ' . strlen($this->compiledData) . ' Bytes read.');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': ' . strlen($this->compiledData) . ' Bytes read.');
                return $this->compiledData;
        }
 
                return $this->compiledData;
        }
 
@@ -761,7 +761,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $ioInstance = $this->getFileIoInstance();
 
                // Some debug code to look on the file which is being loaded
                $ioInstance = $this->getFileIoInstance();
 
                // Some debug code to look on the file which is being loaded
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': FQFN=' . $fqfn);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': FQFN=' . $fqfn);
 
                // Load the raw template
                $rawTemplateData = $ioInstance->loadFileContents($fqfn);
 
                // Load the raw template
                $rawTemplateData = $ioInstance->loadFileContents($fqfn);
@@ -787,7 +787,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $variableName = trim($this->convertDashesToUnderscores($variableName));
 
                // Debug message
                $variableName = trim($this->convertDashesToUnderscores($variableName));
 
                // Debug message
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': varName=' . $varName . ',variableName=' . $variableName);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': varName=' . $varName . ',variableName=' . $variableName);
 
                // Is it not a config variable?
                if ($varName != 'config') {
 
                // Is it not a config variable?
                if ($varName != 'config') {
@@ -813,7 +813,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                preg_match_all('/\$(\w+)(\[(\w+)\])?/', $rawData, $variableMatches);
 
                // Debug message
                preg_match_all('/\$(\w+)(\[(\w+)\])?/', $rawData, $variableMatches);
 
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, true));
 
                // Did we find some variables?
                if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
 
                // Did we find some variables?
                if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
@@ -862,7 +862,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        // RECURSIVE PROTECTION! BE CAREFUL HERE!
                        if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) {
                                // Debug message
                        // RECURSIVE PROTECTION! BE CAREFUL HERE!
                        if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) {
                                // Debug message
-                               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':template=' . $template);
+                               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':template=' . $template);
 
                                // Template not found, but maybe variable assigned?
                                if ($this->getVariableIndex($template, 'config') !== false) {
 
                                // Template not found, but maybe variable assigned?
                                if ($this->getVariableIndex($template, 'config') !== false) {
@@ -1003,7 +1003,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function assignAllVariables (array $varMatches) {
                // Debug message
         */
        private function assignAllVariables (array $varMatches) {
                // Debug message
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':varMatches()=' . count($varMatches));
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':varMatches()=' . count($varMatches));
 
                // Search for all variables
                foreach ($varMatches[1] as $key => $var) {
 
                // Search for all variables
                foreach ($varMatches[1] as $key => $var) {
@@ -1011,7 +1011,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        $var = trim($this->convertDashesToUnderscores($var));
 
                        // Debug message
                        $var = trim($this->convertDashesToUnderscores($var));
 
                        // Debug message
-                       $this->debugOutput(__METHOD__ . ':key=' . $key . ',var=' . $var);
+                       self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':key=' . $key . ',var=' . $var);
 
                        // Detect leading equals
                        if (substr($varMatches[2][$key], 0, 1) == '=') {
 
                        // Detect leading equals
                        if (substr($varMatches[2][$key], 0, 1) == '=') {
@@ -1038,19 +1038,19 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function compileRawTemplateData (array $templateMatches) {
                // Debug message
         */
        private function compileRawTemplateData (array $templateMatches) {
                // Debug message
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':loadedRawData()= ' .count($this->loadedRawData));
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':loadedRawData()= ' .count($this->loadedRawData));
 
                // Are some code-templates found which we need to compile?
                if (count($this->loadedRawData) > 0) {
                        // Then compile all!
                        foreach ($this->loadedRawData as $template => $code) {
                                // Debug message
 
                // Are some code-templates found which we need to compile?
                if (count($this->loadedRawData) > 0) {
                        // Then compile all!
                        foreach ($this->loadedRawData as $template => $code) {
                                // Debug message
-                               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':template=' . $template . ',code(' . strlen($code) . ')=' . $code);
+                               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':template=' . $template . ',code(' . strlen($code) . ')=' . $code);
 
                                // Is this template already compiled?
                                if (in_array($template, $this->compiledTemplates)) {
                                        // Then skip it
 
                                // Is this template already compiled?
                                if (in_array($template, $this->compiledTemplates)) {
                                        // Then skip it
-                                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ': Template ' . $template . ' already compiled. SKIPPED!');
+                                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': Template ' . $template . ' already compiled. SKIPPED!');
                                        continue;
                                } // END - if
 
                                        continue;
                                } // END - if
 
@@ -1061,7 +1061,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                                if (($foundIndex !== false) && (isset($templateMatches[3][$foundIndex]))) {
                                        // Split it up with another reg. exp. into variable=value pairs
                                        preg_match_all($this->regExpVarValue, $templateMatches[3][$foundIndex], $varMatches);
                                if (($foundIndex !== false) && (isset($templateMatches[3][$foundIndex]))) {
                                        // Split it up with another reg. exp. into variable=value pairs
                                        preg_match_all($this->regExpVarValue, $templateMatches[3][$foundIndex], $varMatches);
-                                       //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':varMatches=' . print_r($varMatches, true));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':varMatches=' . print_r($varMatches, true));
 
                                        // Assign all variables
                                        $this->assignAllVariables($varMatches);
 
                                        // Assign all variables
                                        $this->assignAllVariables($varMatches);
@@ -1097,7 +1097,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        private function finalizeVariableCompilation () {
                // Get the content
                $content = $this->getRawTemplateData();
        private function finalizeVariableCompilation () {
                // Get the content
                $content = $this->getRawTemplateData();
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': content before=' . strlen($content) . ' (' . md5($content) . ')');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': content before=' . strlen($content) . ' (' . md5($content) . ')');
 
                // Do we have the stack?
                if (!$this->isVarStackSet('general')) {
 
                // Do we have the stack?
                if (!$this->isVarStackSet('general')) {
@@ -1108,7 +1108,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
 
                // Walk through all variables
                foreach ($this->getVarStack('general') as $currEntry) {
 
                // Walk through all variables
                foreach ($this->getVarStack('general') as $currEntry) {
-                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ': name=' . $currEntry['name'] . ', value=<pre>' . htmlentities($currEntry['value']) . '</pre>');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': name=' . $currEntry['name'] . ', value=<pre>' . htmlentities($currEntry['value']) . '</pre>');
                        // Replace all [$var] or {?$var?} with the content
                        // @TODO Old behaviour, will become obsolete!
                        $content = str_replace('$content[' . $currEntry['name'] . ']', $currEntry['value'], $content);
                        // Replace all [$var] or {?$var?} with the content
                        // @TODO Old behaviour, will become obsolete!
                        $content = str_replace('$content[' . $currEntry['name'] . ']', $currEntry['value'], $content);
@@ -1120,7 +1120,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        $content = str_replace('{?' . $currEntry['name'] . '?}', $currEntry['value'], $content);
                } // END - for
 
                        $content = str_replace('{?' . $currEntry['name'] . '?}', $currEntry['value'], $content);
                } // END - for
 
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': content after=' . strlen($content) . ' (' . md5($content) . ')');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': content after=' . strlen($content) . ' (' . md5($content) . ')');
 
                // Set the content back
                $this->setRawTemplateData($content);
 
                // Set the content back
                $this->setRawTemplateData($content);
@@ -1152,7 +1152,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $variableName = trim($this->convertDashesToUnderscores($variableName));
 
                // Sweet and simple...
                $variableName = trim($this->convertDashesToUnderscores($variableName));
 
                // Sweet and simple...
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': variableName=' . $variableName . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($variableName));
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': variableName=' . $variableName . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($variableName));
                $this->setVariable('config', $variableName, $this->getConfigInstance()->getConfigEntry($variableName));
        }
 
                $this->setVariable('config', $variableName, $this->getConfigInstance()->getConfigEntry($variableName));
        }
 
@@ -1182,7 +1182,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Do we have the stack?
                if (!$this->isVarStackSet('general')) {
                        // Abort here silently
                // Do we have the stack?
                if (!$this->isVarStackSet('general')) {
                        // Abort here silently
-                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ': Aborted, variable stack general not found!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': Aborted, variable stack general not found!');
                        return;
                } // END - if
 
                        return;
                } // END - if
 
@@ -1192,13 +1192,13 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        $value = $this->compileRawCode($this->readVariable($currVariable['name']), true);
 
                        // Debug message
                        $value = $this->compileRawCode($this->readVariable($currVariable['name']), true);
 
                        // Debug message
-                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ': name=' . $currVariable['name'] . ',value=' . $value);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': name=' . $currVariable['name'] . ',value=' . $value);
 
                        // Remove it from stack
                        $this->removeVariable($currVariable['name'], 'general');
 
                        // Re-assign the variable
 
                        // Remove it from stack
                        $this->removeVariable($currVariable['name'], 'general');
 
                        // Re-assign the variable
-                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ': value='. $value . ',name=' . $currVariable['name'] . ',index=' . $index);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': value='. $value . ',name=' . $currVariable['name'] . ',index=' . $index);
                        $this->assignConfigVariable($value);
                } // END - foreach
        }
                        $this->assignConfigVariable($value);
                } // END - foreach
        }
@@ -1217,7 +1217,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Iterate through all general variables
                foreach ($this->getVarStack('general') as $currVariable) {
                        // Transfer it's name/value combination to the $content array
                // Iterate through all general variables
                foreach ($this->getVarStack('general') as $currVariable) {
                        // Transfer it's name/value combination to the $content array
-                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ':' . $currVariable['name'] . '=<pre>' . htmlentities($currVariable['value']).'</pre>');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':' . $currVariable['name'] . '=<pre>' . htmlentities($currVariable['value']).'</pre>');
                        $dummy[$currVariable['name']] = $currVariable['value'];
                }// END - if
 
                        $dummy[$currVariable['name']] = $currVariable['value'];
                }// END - if
 
@@ -1274,7 +1274,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        // Goes something wrong?
                        if ((!isset($result)) || (empty($result))) {
                                // Output eval command
                        // Goes something wrong?
                        if ((!isset($result)) || (empty($result))) {
                                // Output eval command
-                               $this->debugOutput(sprintf("Failed eval() code: <pre>%s</pre>", $this->markupCode($eval, true)), true);
+                               self::createDebugInstance(__CLASS__)->debugOutput(sprintf("Failed eval() code: <pre>%s</pre>", $this->markupCode($eval, true)), true);
 
                                // Output backtrace here
                                $this->debugBackTrace();
 
                                // Output backtrace here
                                $this->debugBackTrace();
@@ -1324,7 +1324,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                preg_match_all($this->regExpCodeTags, $rawData, $templateMatches);
 
                // Debug message
                preg_match_all($this->regExpCodeTags, $rawData, $templateMatches);
 
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':templateMatches=' . print_r($templateMatches , true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':templateMatches=' . print_r($templateMatches , true));
 
                // Analyze the matches array
                if ((is_array($templateMatches)) && (count($templateMatches) == 4) && (count($templateMatches[0]) > 0)) {
 
                // Analyze the matches array
                if ((is_array($templateMatches)) && (count($templateMatches) == 4) && (count($templateMatches[0]) > 0)) {
@@ -1431,22 +1431,22 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function compileRawCode ($rawCode, $setMatchAsCode=false) {
                // Find the variables
         */
        public function compileRawCode ($rawCode, $setMatchAsCode=false) {
                // Find the variables
-               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
                preg_match_all($this->regExpVarValue, $rawCode, $varMatches);
 
                // Compile all variables
                preg_match_all($this->regExpVarValue, $rawCode, $varMatches);
 
                // Compile all variables
-               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':<pre>' . print_r($varMatches, true) . '</pre>');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':<pre>' . print_r($varMatches, true) . '</pre>');
                foreach ($varMatches[0] as $match) {
                        // Add variable tags around it
                        $varCode = '{?' . $match . '?}';
 
                        // Debug message
                foreach ($varMatches[0] as $match) {
                        // Add variable tags around it
                        $varCode = '{?' . $match . '?}';
 
                        // Debug message
-                       //* DEBUG: */ $this->debugOutput(__METHOD__ . ':varCode=' . $varCode);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':varCode=' . $varCode);
 
                        // Is the variable found in code? (safes some calls)
                        if (strpos($rawCode, $varCode) !== false) {
                                // Debug message
 
                        // Is the variable found in code? (safes some calls)
                        if (strpos($rawCode, $varCode) !== false) {
                                // Debug message
-                               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': match=' . $match . ',rawCode[' . gettype($rawCode) . ']=' . $rawCode);
+                               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': match=' . $match . ',rawCode[' . gettype($rawCode) . ']=' . $rawCode);
 
                                // Use $match as new value or $value from read variable?
                                if ($setMatchAsCode === true) {
 
                                // Use $match as new value or $value from read variable?
                                if ($setMatchAsCode === true) {
@@ -1463,7 +1463,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                } // END - foreach
 
                // Return the compiled data
                } // END - foreach
 
                // Return the compiled data
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
                return $rawCode;
        }
 
                return $rawCode;
        }
 
@@ -1484,7 +1484,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      void
         */
        public function renameVariable ($oldName, $newName) {
         * @return      void
         */
        public function renameVariable ($oldName, $newName) {
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': oldName=' . $oldName . ', newName=' . $newName);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': oldName=' . $oldName . ', newName=' . $newName);
                // Get raw template code
                $rawData = $this->getRawTemplateData();
 
                // Get raw template code
                $rawData = $this->getRawTemplateData();
 
index 3e3332c3da6ed66fe232aae16abc37b5fc80d57e..0bf8b6c692c44602f56a07ed154253411fc52afb 100644 (file)
@@ -53,9 +53,6 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
                // Get instance
                $databaseInstance = new DatabaseConnection();
 
                // Get instance
                $databaseInstance = new DatabaseConnection();
 
-               // Set debug output handler
-               $databaseInstance->setDebugInstance($debugInstance);
-
                // Set database layer
                $databaseInstance->setDatabaseLayer($dbLayer);
 
                // Set database layer
                $databaseInstance->setDatabaseLayer($dbLayer);
 
index e0bf69dc10a586462f8332b7119d3302511b4838..533dce3e2fb0b7744dd4fa4c6b968c7c0c8656c9 100644 (file)
@@ -119,15 +119,22 @@ class FileIoHandler extends BaseMiddleware {
        /**
         * Saves a file with data by using the current output stream
         *
        /**
         * Saves a file with data by using the current output stream
         *
-        * @param       $fileName       Name of the file
-        * @param       $dataArray      Array with file contents
+        * @param       $fileName               Name of the file
+        * @param       $dataStream             File data stream
         * @return      void
         * @see         FileOutputStreamer
         */
         * @return      void
         * @see         FileOutputStreamer
         */
-       public function saveFile ($fileName, $dataArray) {
+       public function saveFile ($fileName, $dataStream) {
                // Get output stream
                $outInstance = $this->getOutputStream();
 
                // Get output stream
                $outInstance = $this->getOutputStream();
 
+               // Prepare output array
+               $dataArray = array(
+                       // @TODO What is this for?
+                       0 => $this->__toString(),
+                       1 => $dataStream
+               );
+
                // Send the fileName and dataArray to the output handler
                $outInstance->saveFile($fileName, $dataArray);
        }
                // Send the fileName and dataArray to the output handler
                $outInstance->saveFile($fileName, $dataArray);
        }