Debug infos with var()=%d are for length and can be decimal.
authorRoland Haeder <roland@mxchange.org>
Wed, 27 May 2015 02:23:42 +0000 (04:23 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 27 May 2015 02:23:42 +0000 (04:23 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/feature/class_FrameworkFeature.php
inc/classes/main/file_directories/binary/class_BaseBinaryFile.php
inc/classes/main/file_directories/text/input/csv/class_CsvInputFile.php
inc/classes/main/index/file_stack/class_FileStackIndex.php
inc/classes/main/stacker/file/class_BaseFileStack.php

index dbfe168afe56443e9f9c2dc6b143f4346e030121..4c16afe6649066ddcd55e6ca867adf17cd793248 100644 (file)
@@ -89,6 +89,9 @@ class FrameworkFeature extends BaseFrameworkSystem {
         * @return      $isAvailable    Whether the given feature is available
         */
        public static function isFeatureAvailable ($featureName) {
         * @return      $isAvailable    Whether the given feature is available
         */
        public static function isFeatureAvailable ($featureName) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: featureName=%s - CALLED!', __METHOD__, __LINE__, $featureName));
+
                // Is the cache set?
                if (!isset(self::$enabledFeatures[$featureName]['is_available'])) {
                        // Default is not available
                // Is the cache set?
                if (!isset(self::$enabledFeatures[$featureName]['is_available'])) {
                        // Default is not available
@@ -98,12 +101,16 @@ class FrameworkFeature extends BaseFrameworkSystem {
                        // Is the feature enabled?
                        if (!self::isFeatureEnabled($featureName)) {
                                // Then it can't be available
                        // Is the feature enabled?
                        if (!self::isFeatureEnabled($featureName)) {
                                // Then it can't be available
+                               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Feature "%s"is not enabled.', __METHOD__, __LINE__, $featureName));
                                return FALSE;
                        } // END - if
 
                        // Create config key (for feature class lookup)
                        $configKey = sprintf('feature_%s_class', $featureName);
 
                                return FALSE;
                        } // END - if
 
                        // Create config key (for feature class lookup)
                        $configKey = sprintf('feature_%s_class', $featureName);
 
+                       // Debug message
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: configKey=%s', __METHOD__, __LINE__, $configKey));
+
                        // Now try to get the instance
                        try {
                                // Try to get an instance
                        // Now try to get the instance
                        try {
                                // Try to get an instance
@@ -113,10 +120,13 @@ class FrameworkFeature extends BaseFrameworkSystem {
                                self::$enabledFeatures[$featureName]['is_available'] = self::$enabledFeatures[$featureName]['instance']->isFeatureAvailable();
                        } catch (NoClassException $e) {
                                // Feature class not found
                                self::$enabledFeatures[$featureName]['is_available'] = self::$enabledFeatures[$featureName]['instance']->isFeatureAvailable();
                        } catch (NoClassException $e) {
                                // Feature class not found
-                               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Feature %s not available due to missing feature class. Disabling feature ...', __METHOD__, __LINE__, $featureName));
+                               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Feature "%s"is not available due to missing feature class. Disabling feature ...', __METHOD__, __LINE__, $featureName));
                        }
                } // END - if
 
                        }
                } // END - if
 
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: featureName=%s,isAvailable=%d - EXIT!', __METHOD__, __LINE__, $featureName, intval(self::$enabledFeatures[$featureName]['is_available'])));
+
                // Return "cached" status
                return self::$enabledFeatures[$featureName]['is_available'];
        }
                // Return "cached" status
                return self::$enabledFeatures[$featureName]['is_available'];
        }
index f0c3d925e22c66e60c3590908fb714157c510a3f..e4c3aeb5d5a74fb75fd8a237c091448f4f0bc37e 100644 (file)
@@ -396,7 +396,7 @@ class BaseBinaryFile extends BaseAbstractFile {
         * @return      void
         */
        public function writeData ($seekPosition, $data, $flushHeader = TRUE) {
         * @return      void
         */
        public function writeData ($seekPosition, $data, $flushHeader = TRUE) {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data()=%s - CALLED!', __METHOD__, __LINE__, $seekPosition, strlen($data)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data()=%d - CALLED!', __METHOD__, __LINE__, $seekPosition, strlen($data)));
 
                // Write data at given position
                $this->getPointerInstance()->writeAtPosition($seekPosition, $data);
 
                // Write data at given position
                $this->getPointerInstance()->writeAtPosition($seekPosition, $data);
@@ -641,7 +641,7 @@ class BaseBinaryFile extends BaseAbstractFile {
                        } // END - if
 
                        // Debug message
                        } // END - if
 
                        // Debug message
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] current()=%s', __METHOD__, __LINE__, strlen($current)));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] current()=%d', __METHOD__, __LINE__, strlen($current)));
                } // END - while
 
                // If the last read block is empty, check gaps
                } // END - while
 
                // If the last read block is empty, check gaps
@@ -682,7 +682,7 @@ class BaseBinaryFile extends BaseAbstractFile {
                } // END - if
 
                // Debug message
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] key()=%s', __FUNCTION__, __LINE__, $this->key()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] key()=%d', __FUNCTION__, __LINE__, $this->key()));
 
                // Make sure the block instance is set
                assert($this->getBlockInstance() instanceof CalculatableBlock);
 
                // Make sure the block instance is set
                assert($this->getBlockInstance() instanceof CalculatableBlock);
@@ -707,7 +707,7 @@ class BaseBinaryFile extends BaseAbstractFile {
                        $block = $this->read($length);
 
                        // Debug message
                        $block = $this->read($length);
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] block()=%s,length=%s', __FUNCTION__, __LINE__, strlen($block), $length));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] block()=%d,length=%s', __FUNCTION__, __LINE__, strlen($block), $length));
 
                        // Is it all empty?
                        if (strlen(trim($block)) == 0) {
 
                        // Is it all empty?
                        if (strlen(trim($block)) == 0) {
@@ -722,7 +722,7 @@ class BaseBinaryFile extends BaseAbstractFile {
                        $data .= $block;
 
                        // A debug message
                        $data .= $block;
 
                        // A debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] data()=%s', __FUNCTION__, __LINE__, strlen($data)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] data()=%d', __FUNCTION__, __LINE__, strlen($data)));
                } // END - while
 
                // EOF reached?
                } // END - while
 
                // EOF reached?
index cc1bad8f645c44e5697847c5c15b15674ece773d..9792c6639d787f05978e2674bb00e70fd470791f 100644 (file)
@@ -68,13 +68,13 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                $data = $this->getPointerInstance()->readLine();
 
                // Debug message
                $data = $this->getPointerInstance()->readLine();
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data()=%s', __METHOD__, __LINE__, strlen($data)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data()=%d', __METHOD__, __LINE__, strlen($data)));
 
                // Parse data
                $lineArray = $this->parseDataToIndexedArray($data, $columnSeparator);
 
                // Debug message
 
                // Parse data
                $lineArray = $this->parseDataToIndexedArray($data, $columnSeparator);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%s - EXIT!', __METHOD__, __LINE__, count($lineArray)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - EXIT!', __METHOD__, __LINE__, count($lineArray)));
 
                // Return it
                return $lineArray;
 
                // Return it
                return $lineArray;
@@ -89,7 +89,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
         */
        private function parseDataToIndexedArray ($data, $columnSeparator) {
                // Debug message
         */
        private function parseDataToIndexedArray ($data, $columnSeparator) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data()=%s,columnSeparator=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $columnSeparator));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data()=%d,columnSeparator=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $columnSeparator));
 
                // Init return array
                $lineArray = array();
 
                // Init return array
                $lineArray = array();
@@ -117,7 +117,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                                array_push($lineArray, $column);
 
                                // Debug message
                                array_push($lineArray, $column);
 
                                // Debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%s - After add!', __METHOD__, __LINE__, count($lineArray)));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - After add!', __METHOD__, __LINE__, count($lineArray)));
 
                                // Clear variable ...
                                $column = '';
 
                                // Clear variable ...
                                $column = '';
@@ -157,11 +157,11 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                        array_push($lineArray, $column);
 
                        // Debug message
                        array_push($lineArray, $column);
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%s - After add!', __METHOD__, __LINE__, count($lineArray)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - After add!', __METHOD__, __LINE__, count($lineArray)));
                } // END - if
 
                // Debug message
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%s - EXIT!', __METHOD__, __LINE__, count($lineArray)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - EXIT!', __METHOD__, __LINE__, count($lineArray)));
 
                // Return it
                return $lineArray;
 
                // Return it
                return $lineArray;
index 9075e5c21ee3c8460eb7bd3fc9b9babdfc0d8eac..f5a4585de677f9bdf9ec87d960a1eb9b4b67ac49 100644 (file)
@@ -72,7 +72,7 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable {
                );
 
                // Debug message
                );
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%s', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData)));
 
                // Search for next free gap
                $gapPosition = $this->getIteratorInstance()->searchNextGap(strlen($rawData));
 
                // Search for next free gap
                $gapPosition = $this->getIteratorInstance()->searchNextGap(strlen($rawData));
@@ -87,7 +87,7 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable {
                $this->getIteratorInstance()->writeData($gapPosition, $rawData);
 
                // Debug message
                $this->getIteratorInstance()->writeData($gapPosition, $rawData);
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%s - EXIT!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d - EXIT!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData)));
        }
 
        /**
        }
 
        /**
index 826156fde8ce80c6613f7194bc1d6ae7f756321d..0324269484d04812813621fa34ac383c950a4233 100644 (file)
@@ -574,7 +574,7 @@ class BaseFileStack extends BaseStacker {
         */
        public function writeDataToFreeGap ($groupId, $hash, $encoded) {
                // Debug message
         */
        public function writeDataToFreeGap ($groupId, $hash, $encoded) {
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,encoded()=%s - CALLED!', __METHOD__, __LINE__, $groupId, $hash, strlen($encoded)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,encoded()=%d - CALLED!', __METHOD__, __LINE__, $groupId, $hash, strlen($encoded)));
 
                // Raw data been written to the file
                $rawData = sprintf('%s%s%s%s%s',
 
                // Raw data been written to the file
                $rawData = sprintf('%s%s%s%s%s',
@@ -586,7 +586,7 @@ class BaseFileStack extends BaseStacker {
                );
 
                // Debug message
                );
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%s', __METHOD__, __LINE__, $groupId, $hash, strlen($rawData)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d', __METHOD__, __LINE__, $groupId, $hash, strlen($rawData)));
 
                // Search for next free gap
                $gapPosition = $this->getIteratorInstance()->searchNextGap(strlen($rawData));
 
                // Search for next free gap
                $gapPosition = $this->getIteratorInstance()->searchNextGap(strlen($rawData));
@@ -601,7 +601,7 @@ class BaseFileStack extends BaseStacker {
                $this->getIteratorInstance()->writeData($gapPosition, $rawData);
 
                // Debug message
                $this->getIteratorInstance()->writeData($gapPosition, $rawData);
 
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%s - EXIT!', __METHOD__, __LINE__, $groupId, $hash, strlen($rawData)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d - EXIT!', __METHOD__, __LINE__, $groupId, $hash, strlen($rawData)));
 
                // Return gap position, hash and length of raw data
                return array(
 
                // Return gap position, hash and length of raw data
                return array(