From: Roland Haeder Date: Thu, 23 Feb 2017 20:47:59 +0000 (+0100) Subject: Debugging continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=de1f271c2bdb43725f6671ea6588a44cf33bf091;p=core.git Debugging continued: - BaseFrameworkSystem::createDebugInstance() now supports optional line number to trace where the call was made Signed-off-by: Roland Häder --- diff --git a/application/tests/class_ApplicationHelper.php b/application/tests/class_ApplicationHelper.php index 670cf901..a65e2966 100644 --- a/application/tests/class_ApplicationHelper.php +++ b/application/tests/class_ApplicationHelper.php @@ -212,9 +212,9 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // -------------------------- Shutdown phase -------------------------- // Shutting down the hub by saying "good bye" to all connected peers // and other hubs, flushing all queues and caches. - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: Shutdown in progress, main loop exited.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown in progress, main loop exited.'); $this->getControllerInstance()->executeShutdownFilters($requestInstance, $responseInstance); - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: Shutdown completed. (This is the last line.)'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown completed. (This is the last line.)'); } /** diff --git a/inc/database.php b/inc/database.php index 88a69a6a..6bcb5153 100644 --- a/inc/database.php +++ b/inc/database.php @@ -54,4 +54,6 @@ $connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddlewa // Is the app variable there and valid? // @TODO Rewrite this -if (is_object($app)) $app->setDatabaseInstance($connectionInstance); +if (is_object($app)) { + $app->setDatabaseInstance($connectionInstance); +} // END - if diff --git a/inc/main/classes/cache/class_MemoryCache.php b/inc/main/classes/cache/class_MemoryCache.php index a3bdbd60..fb926f43 100644 --- a/inc/main/classes/cache/class_MemoryCache.php +++ b/inc/main/classes/cache/class_MemoryCache.php @@ -142,7 +142,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { // Is the offset there? if ($this->offsetExists($offset)) { // Purge only existing keys - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CACHE: Unsetting cache ' . $offset); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHE: Unsetting cache ' . $offset); $this->dataCache->offsetUnset($offset); } // END - if } diff --git a/inc/main/classes/class_BaseFrameworkSystem.php b/inc/main/classes/class_BaseFrameworkSystem.php index 8f42032f..4ad02eda 100644 --- a/inc/main/classes/class_BaseFrameworkSystem.php +++ b/inc/main/classes/class_BaseFrameworkSystem.php @@ -477,7 +477,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->setRealClass('DestructedObject'); } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) { // Already destructed object - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] The object %s is already destroyed.', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] The object %s is already destroyed.', __CLASS__, $this->__toString() )); @@ -567,7 +567,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Output stub message // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[unknown::%s:] Stub! Args: %s', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[unknown::%s:] Stub! Args: %s', $methodName, $argsString )); @@ -1201,7 +1201,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function setSocketResource ($socketResource) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource=' . $socketResource . ',previous[' . gettype($this->socketResource) . ']=' . $this->socketResource); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource=' . $socketResource . ',previous[' . gettype($this->socketResource) . ']=' . $this->socketResource); $this->socketResource = $socketResource; } @@ -1211,7 +1211,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $socketResource A valid socket resource */ public final function getSocketResource () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource[' . gettype($this->socketResource) . ']=' . $this->socketResource); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': socketResource[' . gettype($this->socketResource) . ']=' . $this->socketResource); return $this->socketResource; } @@ -1222,7 +1222,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function setRegularExpression ($regularExpression) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': regularExpression=' . $regularExpression . ',previous[' . gettype($this->regularExpression) . ']=' . $this->regularExpression); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': regularExpression=' . $regularExpression . ',previous[' . gettype($this->regularExpression) . ']=' . $this->regularExpression); $this->regularExpression = $regularExpression; } @@ -1232,7 +1232,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $regularExpression A valid regular expression */ public final function getRegularExpression () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': regularExpression[' . gettype($this->regularExpression) . ']=' . $this->regularExpression); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . '::' . __FUNCTION__ . ': regularExpression[' . gettype($this->regularExpression) . ']=' . $this->regularExpression); return $this->regularExpression; } @@ -1861,7 +1861,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Debug instance is there? if (!is_null($this->getDebugInstance())) { // Output stub message - self::createDebugInstance(__CLASS__)->debugOutput($stubMessage); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($stubMessage); } else { // Trigger an error trigger_error($stubMessage); @@ -1897,10 +1897,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * Creates an instance of a debugger instance * * @param $className Name of the class (currently unsupported) + * @param $lineNumber Line number where the call was made * @return $debugInstance An instance of a debugger class * @deprecated Not fully, as the new Logger facilities are not finished yet. */ - public final static function createDebugInstance ($className) { + public final static function createDebugInstance ($className, $lineNumber = NULL) { // Is the instance set? if (!Registry::getRegistry()->instanceExists('debug')) { // Init debug instance @@ -1912,7 +1913,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_class'), $className); } catch (NullPointerException $e) { // Didn't work, no instance there - exit('Cannot create debugInstance! Exception=' . $e->__toString() . ', message=' . $e->getMessage()); + exit(sprintf('Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, $e->__toString(), $e->getMessage(), $className, $lineNumber)); } // Empty string should be ignored and used for testing the middleware @@ -2185,7 +2186,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Get current array $fieldArray = $resultInstance->current(); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.':
'.print_r($fieldArray, TRUE).'
'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.':
'.print_r($fieldArray, TRUE).'
'); // Convert dashes to underscore $fieldName2 = self::convertDashesToUnderscores($fieldName); @@ -2196,10 +2197,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $fieldValue = $fieldArray[$fieldName2]; } elseif (defined('DEVELOPER')) { // Missing field entry, may require debugging - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldArray
=' . print_r($fieldArray, TRUE) . '
,fieldName=' . $fieldName . ' not found!'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldArray
=' . print_r($fieldArray, TRUE) . '
,fieldName=' . $fieldName . ' not found!'); } else { // Missing field entry, may require debugging - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldName=' . $fieldName . ' not found!'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldName=' . $fieldName . ' not found!'); } // Return it @@ -2225,7 +2226,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Get current array $fieldArray = $resultInstance->current(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=
'.print_r($fieldArray, TRUE).'
'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=
'.print_r($fieldArray, TRUE).'
'); // Convert dashes to underscore $fieldName = self::convertDashesToUnderscores($fieldName); @@ -2272,7 +2273,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Debug instance is there? if (!is_null($this->getDebugInstance())) { // Output stub message - self::createDebugInstance(__CLASS__)->debugOutput($message); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($message); } else { // Trigger an error trigger_error($message . "
\n"); @@ -2460,7 +2461,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ protected function hex2asc ($hex) { // Check for length, it must be devideable by 2 - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('hex='.$hex); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('hex='.$hex); assert((strlen($hex) % 2) == 0); // Walk the string @@ -2528,7 +2529,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { ); // And return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . ': cacheKey=' . $cacheKey); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . ': cacheKey=' . $cacheKey); return $cacheKey; } @@ -3311,7 +3312,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ protected function packString ($str) { // Debug message - //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('str=' . $str . ' - CALLED!'); + //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('str=' . $str . ' - CALLED!'); // First compress the string (gzcompress is okay) $str = gzcompress($str); @@ -3346,7 +3347,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { } // END - for // Return it - //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('packed=' . $packed . ' - EXIT!'); + //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('packed=' . $packed . ' - EXIT!'); return $packed; } diff --git a/inc/main/classes/client/http/class_HttpClient.php b/inc/main/classes/client/http/class_HttpClient.php index bd06c93f..1c89e942 100644 --- a/inc/main/classes/client/http/class_HttpClient.php +++ b/inc/main/classes/client/http/class_HttpClient.php @@ -121,7 +121,7 @@ class HttpClient extends BaseClient implements Client { // Add last new-line $rawRequest .= self::HTTP_EOL; - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HTTP-CLIENT[' . __METHOD__ . ':' . __LINE__ . ']: rawRequest=' . $rawRequest); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HTTP-CLIENT[' . __METHOD__ . ':' . __LINE__ . ']: rawRequest=' . $rawRequest); // Write request fwrite($this->getSocketResource(), $rawRequest); diff --git a/inc/main/classes/commands/console/class_ConsoleFuseCommand.php b/inc/main/classes/commands/console/class_ConsoleFuseCommand.php index f30aac8a..01fd5236 100644 --- a/inc/main/classes/commands/console/class_ConsoleFuseCommand.php +++ b/inc/main/classes/commands/console/class_ConsoleFuseCommand.php @@ -63,7 +63,7 @@ class ConsoleFuseCommand extends BaseCommand implements Commandable { // Is the feature available? if (!FrameworkFeature::isFeatureAvailable('fuse')) { // Feature not available, cannot continue - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Feature "hub" not available.', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Feature "hub" not available.', __METHOD__, __LINE__ )); diff --git a/inc/main/classes/console/class_ConsoleTools.php b/inc/main/classes/console/class_ConsoleTools.php index 4babb5e4..04476bf5 100644 --- a/inc/main/classes/console/class_ConsoleTools.php +++ b/inc/main/classes/console/class_ConsoleTools.php @@ -54,7 +54,7 @@ class ConsoleTools extends BaseFrameworkSystem { */ protected function resolveIpAddress ($hostname) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] Host name to resolve is: %s', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Host name to resolve is: %s', $this->__toString(), $hostname )); @@ -72,13 +72,13 @@ class ConsoleTools extends BaseFrameworkSystem { $ip = $ipResolved; // Debug message - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] Resolved IP address is: %s', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Resolved IP address is: %s', $this->__toString(), $ip )); } else { // Problem while resolving IP address - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] Problem resolving IP address for host %s. Please check your /etc/hosts file.', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Problem resolving IP address for host %s. Please check your /etc/hosts file.', $this->__toString(), $hostname )); @@ -131,7 +131,7 @@ class ConsoleTools extends BaseFrameworkSystem { // Add last new-line $proxyTunnel .= self::HTTP_EOL; - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONSOLE-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: proxyTunnel=' . $proxyTunnel); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONSOLE-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: proxyTunnel=' . $proxyTunnel); // Write request fwrite($socketResource, $proxyTunnel); @@ -238,13 +238,13 @@ class ConsoleTools extends BaseFrameworkSystem { $ip = $helperInstance->resolveIpAddress($_SERVER['COMPUTERNAME']); } else { // Could not find our hostname - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] WARNING: Cannot resolve my own IP address.', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] WARNING: Cannot resolve my own IP address.', $helperInstance->__toString() )); } } catch (FrameworkException $e) { // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] Problem while resolving own IP address: [%s|%s]:%s', + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Problem while resolving own IP address: [%s|%s]:%s', $helperInstance->__toString(), $e->__toString(), $e->getHexCode(), @@ -351,7 +351,7 @@ class ConsoleTools extends BaseFrameworkSystem { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONSOLE-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Resolved external address: ' . $externalAddress); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONSOLE-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Resolved external address: ' . $externalAddress); // Return determined external address return $externalAddress; diff --git a/inc/main/classes/container/socket/class_SocketContainer.php b/inc/main/classes/container/socket/class_SocketContainer.php index 936874e9..01189966 100644 --- a/inc/main/classes/container/socket/class_SocketContainer.php +++ b/inc/main/classes/container/socket/class_SocketContainer.php @@ -55,7 +55,7 @@ class SocketContainer extends BaseContainer implements Registerable { unset($packageData[NetworkPackage::PACKAGE_DATA_HASH]); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']:socketResource=' . $socketResource . ',packageData='.print_r($packageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']:socketResource=' . $socketResource . ',packageData='.print_r($packageData, TRUE)); // Is the info instance set? if ($infoInstance instanceof ShareableInfo) { @@ -64,18 +64,18 @@ class SocketContainer extends BaseContainer implements Registerable { $helperInstance = $infoInstance->getHelperInstance(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: listenerInstance[]=' . gettype($listenerInstance)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: listenerInstance[]=' . gettype($listenerInstance)); // Is there a listener instance set? if ($listenerInstance instanceof Listenable) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: Setting listenerInstance=' . $listenerInstance->__toString() . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: Setting listenerInstance=' . $listenerInstance->__toString() . ' ...'); // Set it here for later usage $containerInstance->setListenerInstance($listenerInstance); } elseif ($helperInstance instanceof ConnectionHelper) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: Setting helperInstance=' . $helperInstance->__toString() . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: Setting helperInstance=' . $helperInstance->__toString() . ' ...'); // Set it here for later usage $containerInstance->setHelperInstance($helperInstance); @@ -103,7 +103,7 @@ class SocketContainer extends BaseContainer implements Registerable { $packageData = $this->getPackageData(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',packageData=' . print_r($packageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',packageData=' . print_r($packageData, TRUE)); // So, does both match? $matches = ((isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) && ($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] === $unl)); @@ -120,7 +120,7 @@ class SocketContainer extends BaseContainer implements Registerable { */ public final function ifSocketResourceMatches ($socketResource) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[' . gettype($socketResource) . ']=' .$socketResource . ',storedResource[' . gettype($this->getSocketResource()) . ']=' . $this->getSocketResource()); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[' . gettype($socketResource) . ']=' .$socketResource . ',storedResource[' . gettype($this->getSocketResource()) . ']=' . $this->getSocketResource()); // So, does both match? $matches = ((is_resource($socketResource)) && ($socketResource === $this->getSocketResource())); diff --git a/inc/main/classes/controller/class_BaseController.php b/inc/main/classes/controller/class_BaseController.php index abaace75..bc257a7b 100644 --- a/inc/main/classes/controller/class_BaseController.php +++ b/inc/main/classes/controller/class_BaseController.php @@ -186,9 +186,9 @@ class BaseController extends BaseFrameworkSystem implements Registerable { * @return void */ protected function initFilterChain ($filterChain) { - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: START'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: START'); $this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class'); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: FINISHED'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: FINISHED'); } /** @@ -200,7 +200,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { * @throws InvalidFilterChainException If the filter chain is invalid */ protected function addFilter ($filterChain, Filterable $filterInstance) { - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: START'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: START'); // Test if the filter is there if (!isset($this->filterChains[$filterChain])) { @@ -210,7 +210,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable { // Add the filter $this->filterChains[$filterChain]->addFilter($filterInstance); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: FINISH'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: FINISH'); } /** diff --git a/inc/main/classes/criteria/class_BaseCriteria.php b/inc/main/classes/criteria/class_BaseCriteria.php index bb556c59..cab71ab0 100644 --- a/inc/main/classes/criteria/class_BaseCriteria.php +++ b/inc/main/classes/criteria/class_BaseCriteria.php @@ -168,7 +168,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { */ public final function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!'); // Make sure no 'my-' or 'my_' passes this point assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue))); @@ -177,7 +177,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey); // Append it $this->appendStringToGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue); @@ -194,7 +194,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { */ public final function setCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!'); // Make sure no 'my-' or 'my_' passes this point assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue))); @@ -203,7 +203,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey); // Set it $this->setStringGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue); @@ -222,7 +222,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue))); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue); // Add it $this->pushValueToGenericArrayElement('criteria', 'choice', 'entries', self::convertDashesToUnderscores($criteriaKey), (string) $criteriaValue); @@ -264,7 +264,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { */ public function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default') { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaType=' . $criteriaType . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaType=' . $criteriaType . ' - CALLED!'); // Make sure no 'my-' or 'my_' passes this point assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE)); @@ -273,7 +273,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType)); // Default is not found $value = FALSE; @@ -285,7 +285,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: value=' . $value . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: value=' . $value . ' - EXIT!'); // Return the value return $value; @@ -387,7 +387,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { */ public function getCacheKey ($onlyKeys = array(), $criteriaType = 'default') { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($this->__toString() . ': criteriaType=' . $criteriaType . ',count()=' . $this->countGenericArray('criteria'))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . ': criteriaType=' . $criteriaType . ',count()=' . $this->countGenericArray('criteria'))); // Make sure the criteria is there assert($this->isValidGenericArrayGroup('criteria', $criteriaType)); diff --git a/inc/main/classes/criteria/dataset/class_DataSetCriteria.php b/inc/main/classes/criteria/dataset/class_DataSetCriteria.php index 2e69e4c4..777a0fae 100644 --- a/inc/main/classes/criteria/dataset/class_DataSetCriteria.php +++ b/inc/main/classes/criteria/dataset/class_DataSetCriteria.php @@ -121,7 +121,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria { $primaryKeys = $this->getPrimaryKeys(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: tableName=' . $this->getTableName() . ',primaryKey=' . $primaryKey . ',primaryKeys()=' . count($primaryKeys)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: tableName=' . $this->getTableName() . ',primaryKey=' . $primaryKey . ',primaryKeys()=' . count($primaryKeys)); /* * If this is not set, this could mean a badly written frontend as @@ -142,7 +142,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria { } // END - foreach // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: tableName=' . $this->getTableName() . ',return=' . $return . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: tableName=' . $this->getTableName() . ',return=' . $return . ' - EXIT!'); // Return it return $return; @@ -151,13 +151,13 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria { return $primaryKey; } else { // @TODO Issue a warning - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: Primary key not set for table ' . $this->getTableName() . ', please fix your table. Falling back to unique key ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: Primary key not set for table ' . $this->getTableName() . ', please fix your table. Falling back to unique key ...'); // Get unique key $uniqueKey = trim($this->getCriteriaElemnent($this->getUniqueKey())); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: tableName=' . $this->getTableName() . ',uniqueKey=' . $uniqueKey); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: tableName=' . $this->getTableName() . ',uniqueKey=' . $uniqueKey); // Is it empty, too? if (empty($uniqueKey)) { diff --git a/inc/main/classes/criteria/search/class_SearchCriteria.php b/inc/main/classes/criteria/search/class_SearchCriteria.php index 9a647b28..418c1f4c 100644 --- a/inc/main/classes/criteria/search/class_SearchCriteria.php +++ b/inc/main/classes/criteria/search/class_SearchCriteria.php @@ -134,19 +134,19 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { $valueArray = explode($separator, $value); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',value[' . gettype($value) . ']=' . $value . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',value[' . gettype($value) . ']=' . $value . ' - CALLED!'); // Get 'default' search value $searchDefault = $this->getCriteriaElemnent($key); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaElement(' . $key . ')[' . gettype($searchDefault) . ']=' . $searchDefault); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaElement(' . $key . ')[' . gettype($searchDefault) . ']=' . $searchDefault); // 'default' check $isMatching = (((($searchDefault !== FALSE) && ($searchDefault == $value)) || ((is_null($searchDefault)) && (is_null($value)))) || ($searchDefault === FALSE)); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaElement(' . $key . ')[' . gettype($searchDefault) . ']=' . $searchDefault . ',isMatching=' . intval($isMatching)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaElement(' . $key . ')[' . gettype($searchDefault) . ']=' . $searchDefault . ',isMatching=' . intval($isMatching)); // Get 'choice' search value (can be NULL or $separator-separated string) $searchChoice = $this->getCriteriaChoiceElemnent($key); @@ -155,7 +155,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { assert(($searchChoice === FALSE) || (is_array($searchChoice))); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[' . gettype($searchChoice) . ']=' . print_r($searchChoice, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[' . gettype($searchChoice) . ']=' . print_r($searchChoice, TRUE)); // 'choice' check if ((is_array($searchChoice)) && (count($valueArray) == 1)) { @@ -163,41 +163,41 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { $isMatching = ((($isMatching === TRUE) || (($searchDefault === FALSE) && (!is_null($value)))) && (in_array($value, $searchChoice))); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - SINGLE-MATCH'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - SINGLE-MATCH'); } elseif ((is_array($searchChoice)) && (count($valueArray) > 1)) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',valueArray()=' . count($valueArray) . ',isMatching=' . intval($isMatching)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',valueArray()=' . count($valueArray) . ',isMatching=' . intval($isMatching)); // $value is choice-search value, so check all entries $isMatching = (($isMatching === TRUE) || (($searchDefault === FALSE) && (!is_null($value)))); $idx = 0; foreach ($valueArray as $idx => $match) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',count(searchChoice)=' . count($searchChoice)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',count(searchChoice)=' . count($searchChoice)); // Is it found? (one is okay) $isMatching = (($isMatching === TRUE) && (in_array($match, $searchChoice))); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',isMatching=' . intval($isMatching)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',isMatching=' . intval($isMatching)); } // END - foreach // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',valueArray()=' . count($valueArray) . ',idx=' . $idx . ',isMatching=' . intval($isMatching) . ' - CHOICE-MATCH'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',valueArray()=' . count($valueArray) . ',idx=' . $idx . ',isMatching=' . intval($isMatching) . ' - CHOICE-MATCH'); } else { // Choice-match is FALSE // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - FALSE-MATCH'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - FALSE-MATCH'); } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',isMatching=' . intval($isMatching)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',isMatching=' . intval($isMatching)); // Get 'exclude' search value $searchExclude = $this->getCriteriaExcludeElemnent($key); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaExcludeElement(' . $key . ')[' . gettype($searchExclude) . ']=' . $searchExclude); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaExcludeElement(' . $key . ')[' . gettype($searchExclude) . ']=' . $searchExclude); // 'exclude' check $isMatching = ( @@ -221,7 +221,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { ); // Return result - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - EXIT!'); return $isMatching; } diff --git a/inc/main/classes/database/backend/class_CachedLocalFileDatabase.php b/inc/main/classes/database/backend/class_CachedLocalFileDatabase.php index 5c887e5b..a8d0071b 100644 --- a/inc/main/classes/database/backend/class_CachedLocalFileDatabase.php +++ b/inc/main/classes/database/backend/class_CachedLocalFileDatabase.php @@ -170,7 +170,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac */ private function getDataArrayFromFile ($fqfn) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Reading elements from database file ' . $fqfn . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Reading elements from database file ' . $fqfn . ' ...'); // Init compressed data $compressedData = $this->getFileIoInstance()->loadFileContents($fqfn); @@ -186,8 +186,8 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac $dataArray = json_decode($serializedData, TRUE); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Read ' . count($dataArray) . ' elements from database file ' . $fqfn . '.'); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Read ' . count($dataArray) . ' elements from database file ' . $fqfn . '.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE)); // Finally return it return $dataArray; @@ -202,20 +202,20 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac */ private function writeDataArrayToFqfn ($fqfn, array $dataArray) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file ' . $fqfn . ' ...'); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file ' . $fqfn . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE)); // Serialize and compress it $compressedData = $this->getCompressorChannel()->getCompressor()->compressStream(json_encode($dataArray)); // Write data - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Writing ' . strlen($compressedData) . ' bytes ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Writing ' . strlen($compressedData) . ' bytes ...'); // Write this data BASE64 encoded to the file $this->getFileIoInstance()->saveStreamToFile($fqfn, $compressedData, $this); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file completed.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file completed.'); } /** @@ -313,7 +313,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac $infoArray = $this->getContentsFromTableInfoFile($dataSetInstance); // Is the primary key there? - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: tableInfo=' . print_r($this->tableInfo, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableInfo=' . print_r($this->tableInfo, TRUE)); if (!isset($this->tableInfo[$tableName]['primary'])) { // Then create the info file $this->createTableInfoFile($dataSetInstance); @@ -347,7 +347,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac */ public function querySelect ($tableName, LocalSearchCriteria $searchInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: tableName=' . $tableName . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableName=' . $tableName . ' - CALLED!'); // The result is null by any errors $resultData = NULL; @@ -377,7 +377,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac // Read the directory with some exceptions while (($dataFile = $directoryInstance->readDirectoryExcept(array('.htaccess', 'info.' . $this->getFileExtension()))) && (($limitFound < $searchInstance->getLimit()) || ($searchInstance->getLimit() == 0))) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',this->getFileExtension()=' . $this->getFileExtension()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',this->getFileExtension()=' . $this->getFileExtension()); // Does the extension match? if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) { @@ -387,7 +387,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac // Read the file $dataArray = $this->getDataArrayFromFile($pathName . $dataFile); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE)); // Is this an array? if (is_array($dataArray)) { @@ -401,11 +401,11 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac // Found one entry? $isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value))); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: key=' . $key . ',value=' . $value . ',isFound=' . intval($isFound)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: key=' . $key . ',value=' . $value . ',isFound=' . intval($isFound)); } // END - foreach // Is all found? - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: isFound=' . intval($isFound) . ',limitFound=' . $limitFound . ',limit=' . $searchInstance->getLimit()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: isFound=' . intval($isFound) . ',limitFound=' . $limitFound . ',limit=' . $searchInstance->getLimit()); if ($isFound === TRUE) { // Shall we skip this entry? if ($searchInstance->getSkip() > 0) { @@ -421,7 +421,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac $dataArray[$this->getIndexKey()] = $idx; // Entry found! - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, TRUE)); array_push($resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS], $dataArray); // Count found entries up @@ -518,14 +518,14 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac // Does the extension match? if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!'); // 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)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE)); // Is this an array? if (is_array($dataArray)) { @@ -542,14 +542,14 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac } // END - foreach // Is all found? - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: isFound=' . intval($isFound)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: isFound=' . intval($isFound)); if ($isFound === TRUE) { // Shall we skip this entry? if ($searchInstance->getSkip() > 0) { // We shall skip some entries if ($skipFound < $searchInstance->getSkip()) { // Skip this entry - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Found entry, but skipping ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Found entry, but skipping ...'); $skipFound++; break; } // END - if @@ -562,12 +562,12 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac assert($searchKey != $this->indexKey); // Debug message + add/update it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: criteriaKey=' . $searchKey . ',criteriaValue=' . $searchValue); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: criteriaKey=' . $searchKey . ',criteriaValue=' . $searchValue); $dataArray[$searchKey] = $searchValue; } // END - foreach // Write the data to a local file - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Writing dataArray()=' . count($dataArray) . ' to ' . $dataFile . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Writing dataArray()=' . count($dataArray) . ' to ' . $dataFile . ' ...'); $this->writeDataArrayToFqfn($pathName . $dataFile, $dataArray); // Count found entries up @@ -626,7 +626,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac unset($data[$this->indexKey]); // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: data[' . gettype($data) . ']='.print_r($data, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: data[' . gettype($data) . ']='.print_r($data, TRUE)); return $data; } @@ -637,7 +637,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac * @return $count Total rows of given table */ public function countTotalRows($tableName) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: tableName=' . $tableName . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableName=' . $tableName . ' - CALLED!'); // Create full path name $pathName = $this->getConfigInstance()->getConfigEntry('local_db_path') . $tableName . '/'; @@ -655,13 +655,13 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac // Does the extension match? if (substr($dataFile, -(strlen($this->getFileExtension()))) !== $this->getFileExtension()) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - SKIPPED!'); // Skip this file! continue; } // END - if // Count this row up - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - COUNTED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',getFileExtension()=' . $this->getFileExtension() . ' - COUNTED!'); $count++; } // END - while } catch (FrameworkException $e) { @@ -673,7 +673,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac } // Return count - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: tableName=' . $tableName . ',count=' . $count . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableName=' . $tableName . ',count=' . $count . ' - EXIT!'); return $count; } diff --git a/inc/main/classes/database/class_BaseDatabaseWrapper.php b/inc/main/classes/database/class_BaseDatabaseWrapper.php index eade379b..d4d1b1ab 100644 --- a/inc/main/classes/database/class_BaseDatabaseWrapper.php +++ b/inc/main/classes/database/class_BaseDatabaseWrapper.php @@ -99,7 +99,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) { // First get a key suitable for our cache and extend it with this class name $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...'); } // END - if // Does this key exists in cache? @@ -127,7 +127,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) { // First get a key suitable for our cache and extend it with this class name $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...'); } // END - if // Does this key exists in cache? @@ -179,17 +179,17 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { // Does this key exists in cache? if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey . ':' . print_r($this->cacheInstance->offsetGet($cacheKey), TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey . ':' . print_r($this->cacheInstance->offsetGet($cacheKey), TRUE)); // Then use this result $result = $this->cacheInstance->offsetGet($cacheKey); } else { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Quering database, cacheKey=' . $cacheKey); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->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); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: result[]=' . gettype($result)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: result[]=' . gettype($result)); // Cache the result if not null if (!is_null($result)) { @@ -235,7 +235,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { $numRows = $resultInstance->getAffectedRows(); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: numRows=' . $numRows); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: numRows=' . $numRows); } // END - if // Return the result @@ -275,10 +275,10 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { * @return $data A cleaned up array with only public data. */ public function removeNonPublicDataFromArray (array $data) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('WRAPPER[' . $this->__toString() . ']: Calling this->getDatabaseInstance()->removeNonPublicDataFromArray(data) ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('WRAPPER[' . $this->__toString() . ']: Calling this->getDatabaseInstance()->removeNonPublicDataFromArray(data) ...'); $data = $this->getDatabaseInstance()->removeNonPublicDataFromArray($data); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('WRAPPER[' . $this->__toString() . ']: data[]=' . gettype($data)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('WRAPPER[' . $this->__toString() . ']: data[]=' . gettype($data)); return $data; } diff --git a/inc/main/classes/database/result/class_CachedDatabaseResult.php b/inc/main/classes/database/result/class_CachedDatabaseResult.php index 4cc7e26c..4e2bfc9b 100644 --- a/inc/main/classes/database/result/class_CachedDatabaseResult.php +++ b/inc/main/classes/database/result/class_CachedDatabaseResult.php @@ -187,7 +187,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul $isValid = FALSE; // Debug message - //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] this->currentPos=' . $this->currentPos); + //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] this->currentPos=' . $this->currentPos); // Check if all is fine ... if (($this->ifStatusIsOkay()) && (isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][($this->currentPos + 1)])) && (isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][0]))) { @@ -216,7 +216,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul */ public function ifStatusIsOkay () { $ifStatusOkay = ((isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_STATUS])) && ($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_STATUS] === BaseDatabaseBackend::RESULT_OKAY)); - //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] ifStatusOkay=' . intval($ifStatusOkay)); + //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] ifStatusOkay=' . intval($ifStatusOkay)); return $ifStatusOkay; } diff --git a/inc/main/classes/feature/class_FrameworkFeature.php b/inc/main/classes/feature/class_FrameworkFeature.php index 658cdbb4..b72644ab 100644 --- a/inc/main/classes/feature/class_FrameworkFeature.php +++ b/inc/main/classes/feature/class_FrameworkFeature.php @@ -98,7 +98,7 @@ class FrameworkFeature extends BaseFrameworkSystem { */ public static function isFeatureAvailable ($featureName) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: featureName=%s - CALLED!', __METHOD__, __LINE__, $featureName)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: featureName=%s - CALLED!', __METHOD__, __LINE__, $featureName)); // Is the cache set? if (!isset(self::$enabledFeatures[$featureName]['is_available'])) { @@ -109,7 +109,7 @@ class FrameworkFeature extends BaseFrameworkSystem { // 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)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: Feature "%s"is not enabled.', __METHOD__, __LINE__, $featureName)); return FALSE; } // END - if @@ -117,7 +117,7 @@ class FrameworkFeature extends BaseFrameworkSystem { $configKey = sprintf('feature_%s_class', $featureName); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: configKey=%s', __METHOD__, __LINE__, $configKey)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: configKey=%s', __METHOD__, __LINE__, $configKey)); // Now try to get the instance try { @@ -128,12 +128,12 @@ class FrameworkFeature extends BaseFrameworkSystem { 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"is not available due to missing feature class. Disabling feature ...', __METHOD__, __LINE__, $featureName)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: Feature "%s"is not available due to missing feature class. Disabling feature ...', __METHOD__, __LINE__, $featureName)); } } // 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']))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->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']; diff --git a/inc/main/classes/file_directories/binary/class_BaseBinaryFile.php b/inc/main/classes/file_directories/binary/class_BaseBinaryFile.php index f346fb69..9ce33ec2 100644 --- a/inc/main/classes/file_directories/binary/class_BaseBinaryFile.php +++ b/inc/main/classes/file_directories/binary/class_BaseBinaryFile.php @@ -150,7 +150,7 @@ class BaseBinaryFile extends BaseAbstractFile { /* Only for debugging if (isset($this->gaps[0])) { // Output first and last gap - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] this->gaps[0]=%s,this->gaps[%s]=%s', __METHOD__, __LINE__, print_r($this->gaps[0], TRUE), (count($this->gaps) - 1), print_r($this->gaps[count($this->gaps) - 1], TRUE))); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] this->gaps[0]=%s,this->gaps[%s]=%s', __METHOD__, __LINE__, print_r($this->gaps[0], TRUE), (count($this->gaps) - 1), print_r($this->gaps[count($this->gaps) - 1], TRUE))); } // END - if */ @@ -162,7 +162,7 @@ class BaseBinaryFile extends BaseAbstractFile { } // END - if // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] gapsSize=%s,this->headerSize=%s', __METHOD__, __LINE__, $gapsSize, $this->getHeaderSize())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] gapsSize=%s,this->headerSize=%s', __METHOD__, __LINE__, $gapsSize, $this->getHeaderSize())); // Total gap size + header size must be same as file size $isGapsOnly = (($this->getHeaderSize() + $gapsSize) == $this->getFileSize()); @@ -258,16 +258,16 @@ class BaseBinaryFile extends BaseAbstractFile { * @return void */ public function updateSeekPosition () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Get key (= seek position) $seekPosition = $this->key(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Setting seekPosition=%s', __METHOD__, __LINE__, $seekPosition)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Setting seekPosition=%s', __METHOD__, __LINE__, $seekPosition)); // And set it here $this->setSeekPosition($seekPosition); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -277,7 +277,7 @@ class BaseBinaryFile extends BaseAbstractFile { * @return void */ protected function rewindUpdateSeekPosition () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // flushFileHeader must be callable assert(is_callable(array($this, 'flushFileHeader'))); @@ -291,7 +291,7 @@ class BaseBinaryFile extends BaseAbstractFile { // ... to write it back into the file $this->flushFileHeader(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -300,12 +300,12 @@ class BaseBinaryFile extends BaseAbstractFile { * @return void */ protected function seekToOldPosition () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Seek to currently ("old") saved position $this->seek($this->getSeekPosition()); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -402,7 +402,7 @@ class BaseBinaryFile extends BaseAbstractFile { * @return void */ public function writeData ($seekPosition, $data, $flushHeader = TRUE) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data()=%d - CALLED!', __METHOD__, __LINE__, $seekPosition, strlen($data))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data()=%d - CALLED!', __METHOD__, __LINE__, $seekPosition, strlen($data))); // Write data at given position $this->getPointerInstance()->writeAtPosition($seekPosition, $data); @@ -422,7 +422,7 @@ class BaseBinaryFile extends BaseAbstractFile { $this->seekToOldPosition(); } // END - if - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -448,7 +448,7 @@ class BaseBinaryFile extends BaseAbstractFile { * @return $isInitialized Whether the file header is initialized */ public function isFileHeaderInitialized () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Default is not initialized $isInitialized = FALSE; @@ -457,12 +457,12 @@ class BaseBinaryFile extends BaseAbstractFile { if ($this->isFileInitialized()) { // Some bytes has been written, so rewind to start of it. $rewindStatus = $this->rewind(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] rewindStatus=%s', __METHOD__, __LINE__, $rewindStatus)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] rewindStatus=%s', __METHOD__, __LINE__, $rewindStatus)); // Is the rewind() call successfull? if ($rewindStatus != 1) { // Something bad happened - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Could not rewind().', __METHOD__, __LINE__)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Could not rewind().', __METHOD__, __LINE__)); } // END - if // Read file header @@ -473,7 +473,7 @@ class BaseBinaryFile extends BaseAbstractFile { } // END - if // Return result - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] isInitialized=%d - EXIT!', __METHOD__, __LINE__, intval($isInitialized))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] isInitialized=%d - EXIT!', __METHOD__, __LINE__, intval($isInitialized))); return $isInitialized; } @@ -483,11 +483,11 @@ class BaseBinaryFile extends BaseAbstractFile { * @return $isInitialized Whether the file's size is zero */ public function isFileInitialized () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Get it from iterator which holds the pointer instance. If FALSE is returned $fileSize = $this->size(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] fileSize=%s', __METHOD__, __LINE__, $fileSize)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] fileSize=%s', __METHOD__, __LINE__, $fileSize)); /* * The returned file size should not be FALSE or NULL as this means @@ -499,7 +499,7 @@ class BaseBinaryFile extends BaseAbstractFile { $isInitialized = ($fileSize > 0); // Return result - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] isInitialized=%d - EXIT!', __METHOD__, __LINE__, intval($isInitialized))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] isInitialized=%d - EXIT!', __METHOD__, __LINE__, intval($isInitialized))); return $isInitialized; } @@ -509,7 +509,7 @@ class BaseBinaryFile extends BaseAbstractFile { * @return void */ public function createFileHeader () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // The file's header should not be initialized here assert(!$this->isFileHeaderInitialized()); @@ -520,7 +520,7 @@ class BaseBinaryFile extends BaseAbstractFile { // Rewind seek position (to beginning of file) and update/flush file header $this->rewindUpdateSeekPosition(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -530,27 +530,27 @@ class BaseBinaryFile extends BaseAbstractFile { * @return void */ public function preAllocateFile ($type) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Is it enabled? if ($this->getConfigInstance()->getConfigEntry($type . '_pre_allocate_enabled') != 'Y') { // Not enabled - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Not pre-allocating file.', __METHOD__, __LINE__)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Not pre-allocating file.', __METHOD__, __LINE__)); // Don't continue here. return; } // END - if // Message to user - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Pre-allocating file ...', __METHOD__, __LINE__)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Pre-allocating file ...', __METHOD__, __LINE__)); // Calculate minimum length for one entry $minLengthEntry = $this->getBlockInstance()->calculateMinimumBlockLength(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] minLengthEntry=%s', __METHOD__, __LINE__, $minLengthEntry)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] minLengthEntry=%s', __METHOD__, __LINE__, $minLengthEntry)); // Calulcate seek position $seekPosition = $minLengthEntry * $this->getConfigInstance()->getConfigEntry($type . '_pre_allocate_count'); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s', __METHOD__, __LINE__, $seekPosition)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s', __METHOD__, __LINE__, $seekPosition)); // Now simply write a NUL there. This will pre-allocate the file. $this->writeData($seekPosition, chr(0)); @@ -558,7 +558,7 @@ class BaseBinaryFile extends BaseAbstractFile { // Rewind seek position (to beginning of file) and update/flush file header $this->rewindUpdateSeekPosition(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -615,7 +615,7 @@ class BaseBinaryFile extends BaseAbstractFile { * @return void */ public function analyzeFile () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Make sure the file is initialized assert($this->isFileInitialized()); @@ -624,7 +624,7 @@ class BaseBinaryFile extends BaseAbstractFile { $this->initCountersGapsArray(); // Output message (as this may take some time) - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Analyzing file structure ... (this may take some time)', __METHOD__, __LINE__)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Analyzing file structure ... (this may take some time)', __METHOD__, __LINE__)); // First rewind to the begining $this->rewind(); @@ -647,13 +647,13 @@ class BaseBinaryFile extends BaseAbstractFile { } // END - if // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] current()=%d', __METHOD__, __LINE__, strlen($current))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] current()=%d', __METHOD__, __LINE__, strlen($current))); } // END - while // If the last read block is empty, check gaps if (empty($current)) { // Output message - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Found a total of %s gaps.', __METHOD__, __LINE__, count($this->gaps))); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Found a total of %s gaps.', __METHOD__, __LINE__, count($this->gaps))); // Check gaps, if the whole file is empty. if ($this->isFileOnlyGaps()) { @@ -672,7 +672,7 @@ class BaseBinaryFile extends BaseAbstractFile { $this->doRunDefragmentation(); } // END - if } // END - if - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -688,14 +688,14 @@ class BaseBinaryFile extends BaseAbstractFile { } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] key()=%d', __FUNCTION__, __LINE__, $this->key())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d] key()=%d', __FUNCTION__, __LINE__, $this->key())); // Make sure the block instance is set assert($this->getBlockInstance() instanceof CalculatableBlock); // First calculate minimum block length $length = $this->getBlockInstance()->calculateMinimumBlockLength(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] length=%s', __FUNCTION__, __LINE__, $length)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d] length=%s', __FUNCTION__, __LINE__, $length)); // Short be more than zero! assert($length > 0); @@ -713,7 +713,7 @@ class BaseBinaryFile extends BaseAbstractFile { $block = $this->read($length); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] block()=%d,length=%s', __FUNCTION__, __LINE__, strlen($block), $length)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d] block()=%d,length=%s', __FUNCTION__, __LINE__, strlen($block), $length)); // Is it all empty? if (strlen(trim($block)) == 0) { @@ -728,17 +728,17 @@ class BaseBinaryFile extends BaseAbstractFile { $data .= $block; // A debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] data()=%d', __FUNCTION__, __LINE__, strlen($data))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d] data()=%d', __FUNCTION__, __LINE__, strlen($data))); } // END - while // EOF reached? if ($this->isEndOfFileReached()) { // Set whole data as current read block - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('Calling setCurrentBlock(' . strlen($data) . ') ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Calling setCurrentBlock(' . strlen($data) . ') ...'); $this->setCurrentBlock($data); // Then abort here silently - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('EOF reached.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('EOF reached.'); return; } // END - if @@ -752,7 +752,7 @@ class BaseBinaryFile extends BaseAbstractFile { $dataArray = explode(chr(self::SEPARATOR_ENTRIES), $data); // This array must contain two elements - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('dataArray=' . print_r($dataArray, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('dataArray=' . print_r($dataArray, TRUE)); assert(count($dataArray) == 2); // Left part is the actual block, right one the back-buffer data diff --git a/inc/main/classes/file_directories/binary/index/class_IndexFile.php b/inc/main/classes/file_directories/binary/index/class_IndexFile.php index 40d8f8e1..f7335896 100644 --- a/inc/main/classes/file_directories/binary/index/class_IndexFile.php +++ b/inc/main/classes/file_directories/binary/index/class_IndexFile.php @@ -65,7 +65,7 @@ class IndexFile extends BaseBinaryFile implements Block { * @throws UnsupportedOperationException If this method is called */ public function writeValueToFile ($groupId, $value) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -79,7 +79,7 @@ class IndexFile extends BaseBinaryFile implements Block { * @throws UnsupportedOperationException If this method is called */ public function writeDataToFreeGap ($groupId, $hash, $encoded) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',encoded()=' . strlen($encoded)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',encoded()=' . strlen($encoded)); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/file_directories/binary/stack/class_StackFile.php b/inc/main/classes/file_directories/binary/stack/class_StackFile.php index 270c6f85..87b3c0b8 100644 --- a/inc/main/classes/file_directories/binary/stack/class_StackFile.php +++ b/inc/main/classes/file_directories/binary/stack/class_StackFile.php @@ -91,7 +91,7 @@ class StackFile extends BaseBinaryFile implements Block { * @throws UnsupportedOperationException If this method is called */ public function writeDataToFreeGap ($groupId, $hash, $encoded) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',hash=' . $hash . ',encoded()=' . strlen($encoded)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',hash=' . $hash . ',encoded()=' . strlen($encoded)); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/file_directories/class_BaseAbstractFile.php b/inc/main/classes/file_directories/class_BaseAbstractFile.php index 66cb0193..a4f718dc 100644 --- a/inc/main/classes/file_directories/class_BaseAbstractFile.php +++ b/inc/main/classes/file_directories/class_BaseAbstractFile.php @@ -141,7 +141,7 @@ class BaseAbstractFile extends BaseFrameworkSystem implements FilePointer, Close */ public function closeFile () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName())); // Close down pointer instance as well by unsetting it $this->unsetPointerInstance(); @@ -150,7 +150,7 @@ class BaseAbstractFile extends BaseFrameworkSystem implements FilePointer, Close $this->setFileName(''); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__)); } /** diff --git a/inc/main/classes/file_directories/class_BaseFileIo.php b/inc/main/classes/file_directories/class_BaseFileIo.php index cdd1b592..829557ea 100644 --- a/inc/main/classes/file_directories/class_BaseFileIo.php +++ b/inc/main/classes/file_directories/class_BaseFileIo.php @@ -76,7 +76,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi */ public function closeFile () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: fileName=%s - CALLED!', __METHOD__, __LINE__, $this->getFileName())); if (is_null($this->getPointer())) { // Pointer not initialized @@ -87,7 +87,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Closing file %s ...', __METHOD__, __LINE__, $this->getFileName())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: Closing file %s ...', __METHOD__, __LINE__, $this->getFileName())); // Close the file pointer and reset the instance variable @fclose($this->getPointer()); @@ -95,7 +95,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi $this->setFileName(''); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: EXIT!', __METHOD__, __LINE__)); } /** @@ -167,7 +167,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi $status = fseek($this->getPointer(), $offset, $whence); // Return status - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] status=%d', __METHOD__, __LINE__, $status)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] status=%d', __METHOD__, __LINE__, $status)); return $status; } @@ -178,14 +178,14 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi * @todo Handle seekStatus */ public function size () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Get current seek position $seekPosition = $this->determineSeekPosition(); // Seek to end $seekStatus = $this->seek(0, SEEK_END); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekStatus=%d', __METHOD__, __LINE__, $seekStatus)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekStatus=%d', __METHOD__, __LINE__, $seekStatus)); // Get position again (which is the end of the file) $size = $this->determineSeekPosition(); @@ -194,7 +194,7 @@ class BaseFileIo extends BaseFrameworkSystem implements FilePointer, CloseableFi $this->seek($seekPosition); // Return size - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] size=%s - EXIT!', __METHOD__, __LINE__, $size)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] size=%s - EXIT!', __METHOD__, __LINE__, $size)); return $size; } diff --git a/inc/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php b/inc/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php index 6f56e967..b1e85730 100644 --- a/inc/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php +++ b/inc/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php @@ -119,7 +119,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework $pointerInstance->setPathName($pathName); // Return the instance - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: Opened pathName=' . $pathName . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: Opened pathName=' . $pathName . ' - EXIT!'); return $pointerInstance; } @@ -129,7 +129,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework * @return $currentEntry Current entry from encapsulated iterator */ public function readRawDirectory () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . '] - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . '] - CALLED!'); // Can the next entry be read? assert($this->getDirectoryIteratorInstance()->valid()); @@ -138,7 +138,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework $currentEntry = $this->getDirectoryIteratorInstance()->current(); // Return found entry - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: currentEntry[]=' . gettype($currentEntry) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: currentEntry[]=' . gettype($currentEntry) . ' - EXIT!'); return $currentEntry; } @@ -152,11 +152,11 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework // No exceptions given? if (count($except) == 0) { // No exception given, so read all files and directories, but not recursive - self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: No exceptions given, please use readRawDirectory() instead!'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: No exceptions given, please use readRawDirectory() instead!'); return $this->readRawDirectory(); } elseif (!$this->getDirectoryIteratorInstance()->valid()) { // No more left to read - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: EOD reached.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: EOD reached.'); return NULL; } @@ -165,13 +165,13 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework // Read a raw line... $currentEntry = $this->readRawDirectory(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: currentEntry[]=' . gettype($currentEntry)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: currentEntry[]=' . gettype($currentEntry)); // Shall we exclude directories? if (is_object($currentEntry)) { // Get file name $rawLine = $currentEntry->getFilename(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine . ',isDot=' . intval($this->getDirectoryIteratorInstance()->isDot())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine . ',isDot=' . intval($this->getDirectoryIteratorInstance()->isDot())); // Is it a dot-directory or excluded? if (($this->getDirectoryIteratorInstance()->isDot()) || (in_array($rawLine, $except))) { @@ -180,7 +180,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework // Exclude this part $rawLine = $this->readDirectoryExcept($except); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!'); } // END - if } // END - if @@ -188,7 +188,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework $this->getDirectoryIteratorInstance()->next(); // Return read line - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECTORY[' . __METHOD__ . ':' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine); return $rawLine; } diff --git a/inc/main/classes/file_directories/io_stream/class_FileIoStream.php b/inc/main/classes/file_directories/io_stream/class_FileIoStream.php index 028009fb..88fef80b 100644 --- a/inc/main/classes/file_directories/io_stream/class_FileIoStream.php +++ b/inc/main/classes/file_directories/io_stream/class_FileIoStream.php @@ -260,7 +260,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil * @throws UnsupportedOperationException If this method is called */ public function streamData ($data) { - self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/file_directories/text/class_BaseTextFile.php b/inc/main/classes/file_directories/text/class_BaseTextFile.php index b69e6aee..01f78eda 100644 --- a/inc/main/classes/file_directories/text/class_BaseTextFile.php +++ b/inc/main/classes/file_directories/text/class_BaseTextFile.php @@ -55,7 +55,7 @@ class BaseTextFile extends BaseAbstractFile { */ public function seek ($offset, $whence = SEEK_SET) { // Not possible in text files - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -72,7 +72,7 @@ class BaseTextFile extends BaseAbstractFile { * This class (or its implementations) are special file readers/writers. * There is no need to read/write the whole file. */ - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] fqfn=' . $fqfn); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] fqfn=' . $fqfn); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/file_directories/text/input/csv/class_CsvInputFile.php b/inc/main/classes/file_directories/text/input/csv/class_CsvInputFile.php index 0d1170b1..e004980b 100644 --- a/inc/main/classes/file_directories/text/input/csv/class_CsvInputFile.php +++ b/inc/main/classes/file_directories/text/input/csv/class_CsvInputFile.php @@ -62,19 +62,19 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { */ public function readCsvFileLine ($columnSeparator) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] columnSeparator=%s - CALLED!', __METHOD__, __LINE__, $columnSeparator)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] columnSeparator=%s - CALLED!', __METHOD__, __LINE__, $columnSeparator)); // Read raw line $data = $this->getPointerInstance()->readLine(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data()=%d', __METHOD__, __LINE__, strlen($data))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] data()=%d', __METHOD__, __LINE__, strlen($data))); // Parse data $lineArray = $this->parseDataToIndexedArray($data, $columnSeparator); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - EXIT!', __METHOD__, __LINE__, count($lineArray))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - EXIT!', __METHOD__, __LINE__, count($lineArray))); // Return it return $lineArray; @@ -89,7 +89,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { */ private function parseDataToIndexedArray ($data, $columnSeparator) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data()=%d,columnSeparator=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $columnSeparator)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] data()=%d,columnSeparator=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $columnSeparator)); // Init return array $lineArray = array(); @@ -106,18 +106,18 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { $char = substr($data, $idx, 1); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] idx=%s,char=%s ...', __METHOD__, __LINE__, $idx, $char)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] idx=%s,char=%s ...', __METHOD__, __LINE__, $idx, $char)); // Is the column separator found and not within quotes? if (($isInQuotes === FALSE) && ($char == $columnSeparator)) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Adding column=%s ...', __METHOD__, __LINE__, $column)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Adding column=%s ...', __METHOD__, __LINE__, $column)); // Add this line to the array array_push($lineArray, $column); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - After add!', __METHOD__, __LINE__, count($lineArray))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - After add!', __METHOD__, __LINE__, count($lineArray))); // Clear variable ... $column = ''; @@ -126,7 +126,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { continue; } elseif ($char == chr(34)) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] column=%s ...', __METHOD__, __LINE__, $column)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] column=%s ...', __METHOD__, __LINE__, $column)); // $column must be empty at this point if we are at starting quote assert(($isInQuotes === TRUE) || (empty($column))); @@ -135,14 +135,14 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { $isInQuotes = (!$isInQuotes); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] isInQuotes=%d ...', __METHOD__, __LINE__, intval($isInQuotes))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] isInQuotes=%d ...', __METHOD__, __LINE__, intval($isInQuotes))); // Skip double-quote (escaping of them is not yet supported) continue; } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Adding char=%s ...', __METHOD__, __LINE__, $idx, $char)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Adding char=%s ...', __METHOD__, __LINE__, $idx, $char)); // Add char to column $column .= $char; @@ -151,17 +151,17 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { // Is there something outstanding? if (!empty($column)) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Adding column=%s ...', __METHOD__, __LINE__, $column)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Adding column=%s ...', __METHOD__, __LINE__, $column)); // Then don't forget this. :-) array_push($lineArray, $column); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - After add!', __METHOD__, __LINE__, count($lineArray))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - After add!', __METHOD__, __LINE__, count($lineArray))); } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - EXIT!', __METHOD__, __LINE__, count($lineArray))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - EXIT!', __METHOD__, __LINE__, count($lineArray))); // Return it return $lineArray; diff --git a/inc/main/classes/filter/class_FilterChain.php b/inc/main/classes/filter/class_FilterChain.php index 2ff8ad3c..de1e0da0 100644 --- a/inc/main/classes/filter/class_FilterChain.php +++ b/inc/main/classes/filter/class_FilterChain.php @@ -120,19 +120,19 @@ class FilterChain extends BaseFrameworkSystem implements Registerable { */ public function processFilters (Requestable $requestInstance, Responseable $responseInstance) { // Run all filters - //* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('COUNT=' . $this->countGenericArray('filters')); + //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COUNT=' . $this->countGenericArray('filters')); foreach ($this->getFilters() as $filterInstance) { // Must be an instance of Filterable assert($filterInstance instanceof Filterable); // Try to execute this filter try { - //* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing started.'); + //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing started.'); $filterInstance->execute($requestInstance, $responseInstance); - //* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing ended.'); + //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing ended.'); } catch (FilterChainException $e) { // This exception can be thrown to just skip any further processing - self::createDebugInstance(__CLASS__)->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage()); break; } } // END - foreach diff --git a/inc/main/classes/handler/raw_data/class_BaseDataHandler.php b/inc/main/classes/handler/raw_data/class_BaseDataHandler.php index d1212ee3..5cdf4aff 100644 --- a/inc/main/classes/handler/raw_data/class_BaseDataHandler.php +++ b/inc/main/classes/handler/raw_data/class_BaseDataHandler.php @@ -108,7 +108,7 @@ abstract class BaseDataHandler extends BaseHandler { */ protected function prepareAnswerMessage (array $messageData, Deliverable $packageInstance) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MESSAGE-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Going to send an answer message for ' . $this->getHandlerName() . ' ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MESSAGE-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Going to send an answer message for ' . $this->getHandlerName() . ' ...'); // Get a helper instance based on this handler's name $helperInstance = ObjectFactory::createObjectByConfiguredName('node_answer_' . $this->getHandlerName() . '_helper_class', array($messageData)); @@ -137,7 +137,7 @@ abstract class BaseDataHandler extends BaseHandler { $this->removeMessageConfigurationData($messageData); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MESSAGE-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Answer message has been prepared.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MESSAGE-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Answer message has been prepared.'); } /** @@ -149,7 +149,7 @@ abstract class BaseDataHandler extends BaseHandler { */ protected function prepareNextMessage (array $messageData, Deliverable $packageInstance) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MESSAGE-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Going to send next message ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MESSAGE-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Going to send next message ...'); // Get a helper instance based on this handler's name $helperInstance = ObjectFactory::createObjectByConfiguredName('node_next_' . $this->getHandlerName() . '_helper_class', array($messageData)); @@ -178,7 +178,7 @@ abstract class BaseDataHandler extends BaseHandler { $this->removeMessageConfigurationData($messageData); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MESSAGE-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Next message has been prepared.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MESSAGE-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Next message has been prepared.'); } /** diff --git a/inc/main/classes/handler/tasks/class_TaskHandler.php b/inc/main/classes/handler/tasks/class_TaskHandler.php index b87a8f60..b52d3bd3 100644 --- a/inc/main/classes/handler/tasks/class_TaskHandler.php +++ b/inc/main/classes/handler/tasks/class_TaskHandler.php @@ -55,7 +55,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $handlerInstance = new TaskHandler(); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Initializing task handler.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Initializing task handler.'); // Init the task list $handlerInstance->setListInstance(ObjectFactory::createObjectByConfiguredName('task_list_class')); @@ -71,7 +71,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $handlerInstance->registerTask('idle_loop', $taskInstance); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task handler initialized.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task handler initialized.'); // Return the prepared instance return $handlerInstance; @@ -106,7 +106,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { // Should we start now? if ($diff < $currentTask['task_startup_delay']) { // Skip this silently - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' not started: diff=' . $diff . ',task_startup_delay=' . $currentTask['task_startup_delay']); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' not started: diff=' . $diff . ',task_startup_delay=' . $currentTask['task_startup_delay']); return; } // END - if @@ -115,14 +115,14 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $updateTask = TRUE; // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms'); } // END - if // Get time difference from interval delay $diff = ($this->getMilliTime() - $currentTask['task_last_activity']) * 1000; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' diff=' . $diff . ',task_interval_delay=' . $currentTask['task_interval_delay'] . ',task_max_runs=' . $currentTask['task_max_runs'] . ',task_total_runs=' . $currentTask['task_total_runs']); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' diff=' . $diff . ',task_interval_delay=' . $currentTask['task_interval_delay'] . ',task_max_runs=' . $currentTask['task_max_runs'] . ',task_total_runs=' . $currentTask['task_total_runs']); // Is the interval delay reached? if ((($diff < $currentTask['task_interval_delay']) && ($currentTask['task_max_runs'] == 0)) || (($currentTask['task_max_runs'] > 0) && ($currentTask['task_total_runs'] == $currentTask['task_max_runs']))) { @@ -175,13 +175,13 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { */ private function unregisterTask (array $taskData) { // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Removing task ' . $taskData['id'] . ' from queue - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Removing task ' . $taskData['id'] . ' from queue - CALLED!'); // Remove the entry $this->getListInstance()->removeEntry('tasks', $taskData); // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Removing task ' . $taskData['id'] . ' from queue - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Removing task ' . $taskData['id'] . ' from queue - EXIT!'); } /** @@ -260,7 +260,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $this->getListInstance()->addEntry('tasks', $taskEntry); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task registered: taskName=' . $taskName . + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task registered: taskName=' . $taskName . ' (taskInstance=' . $taskInstance->__toString() . ')' . ', startupDelay=' . $taskEntry['task_startup_delay'] . 'ms' . ', intervalDelay=' . $taskEntry['task_interval_delay'] . 'ms' . @@ -314,7 +314,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $this->getListInstance()->getIterator()->rewind(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down all ' . $this->getListInstance()->count() . ' tasks...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down all ' . $this->getListInstance()->count() . ' tasks...'); // Remember all tasks that has been shutdown for removal $tasks = array(); @@ -328,7 +328,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $currentTask = $this->getListInstance()->getIterator()->current(); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down task ' . $currentTask['id'] . ' (taskInstance=' . $currentTask['task_instance']->__toString() . ') ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down task ' . $currentTask['id'] . ' (taskInstance=' . $currentTask['task_instance']->__toString() . ') ...'); // Shutdown the task $currentTask['task_instance']->accept($this->getVisitorInstance()); @@ -341,7 +341,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { } // END - while // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Shutdown of all tasks completed.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Shutdown of all tasks completed.'); // Remove all tasks foreach ($tasks as $entry) { diff --git a/inc/main/classes/helper/class_BaseHelper.php b/inc/main/classes/helper/class_BaseHelper.php index 1368fdb7..34958ab0 100644 --- a/inc/main/classes/helper/class_BaseHelper.php +++ b/inc/main/classes/helper/class_BaseHelper.php @@ -195,7 +195,7 @@ class BaseHelper extends BaseFrameworkSystem { public function assignFieldWithFilter ($fieldName, $filterMethod) { // Get the value $fieldValue = $this->getValueField($fieldName); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'='.$fieldValue); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'='.$fieldValue); // Now filter it through the value through the filter method $filteredValue = call_user_func_array(array($this, 'doFilter' . self::convertToClassName($filterMethod)), array($fieldValue)); @@ -213,14 +213,14 @@ class BaseHelper extends BaseFrameworkSystem { * @throws NullPointerException If recovery of requested value instance failed */ public function prefetchValueInstance ($registryKey, $extraKey = NULL) { - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('O:'.$registryKey.'/'.$extraKey); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->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 - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($registryKey.'=NULL!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($registryKey.'=NULL!'); } // Shall we get an extra instance? @@ -232,7 +232,7 @@ class BaseHelper extends BaseFrameworkSystem { // Try to create it $this->extraInstance = ObjectFactory::createObjectByConfiguredName($extraKey . '_class', array($this->valueInstance)); } - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!'); } // END - if // Is the value instance valid? @@ -478,11 +478,11 @@ class BaseHelper extends BaseFrameworkSystem { if ($this->getValueInstance()->isFieldSet($fieldName)) { // Get the field value $fieldValue = $this->getValueInstance()->getField($fieldName); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Value instance!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Value instance!'); } elseif ((!is_null($this->extraInstance)) && ($this->extraInstance->isFieldSet($fieldName))) { // So try the extra instance $fieldValue = $this->extraInstance->getField($fieldName); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Extra instance!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Extra instance!'); } else { // Field is not set $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] fieldName=' . $fieldName . ' is not set! - @TODO'); diff --git a/inc/main/classes/index/class_BaseIndex.php b/inc/main/classes/index/class_BaseIndex.php index be4fe1fe..8c000fa1 100644 --- a/inc/main/classes/index/class_BaseIndex.php +++ b/inc/main/classes/index/class_BaseIndex.php @@ -66,23 +66,23 @@ class BaseIndex extends BaseFrameworkSystem { * @return void */ public function readFileHeader () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // First rewind to beginning as the header sits at the beginning ... $this->getIteratorInstance()->rewind(); // Then read it (see constructor for calculation) $data = $this->getIteratorInstance()->read($this->getIteratorInstance()->getHeaderSize()); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Read %d bytes (%d wanted).', __METHOD__, __LINE__, strlen($data), $this->getIteratorInstance()->getHeaderSize())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Read %d bytes (%d wanted).', __METHOD__, __LINE__, strlen($data), $this->getIteratorInstance()->getHeaderSize())); // Have all requested bytes been read? assert(strlen($data) == $this->getIteratorInstance()->getHeaderSize()); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Last character must be the separator - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data(-1)=%s', __METHOD__, __LINE__, dechex(ord(substr($data, -1, 1))))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] data(-1)=%s', __METHOD__, __LINE__, dechex(ord(substr($data, -1, 1))))); assert(substr($data, -1, 1) == chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES)); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Okay, then remove it $data = substr($data, 0, -1); @@ -102,22 +102,22 @@ class BaseIndex extends BaseFrameworkSystem { $this->getIteratorInstance()->setHeader($header); // Check if the array has only 3 elements - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, TRUE))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, TRUE))); assert(count($header) == 2); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Check magic assert($header[0] == self::INDEX_MAGIC); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Check length of count assert(strlen($header[1]) == BaseBinaryFile::LENGTH_COUNT); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Decode count $header[1] = hex2bin($header[1]); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -126,7 +126,7 @@ class BaseIndex extends BaseFrameworkSystem { * @return void */ public function flushFileHeader () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Put all informations together $header = sprintf('%s%s%s%s', @@ -146,7 +146,7 @@ class BaseIndex extends BaseFrameworkSystem { // Write it to disk (header is always at seek position 0) $this->getIteratorInstance()->writeData(0, $header, FALSE); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -327,7 +327,7 @@ class BaseIndex extends BaseFrameworkSystem { * @throws UnsupportedOperationException This method is not (and maybe never will be) supported */ public function writeData ($seekPosition, $data, $flushHeader = TRUE) { - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data[]=%s,flushHeader=%d', __METHOD__, __LINE__, $seekPosition, gettype($data), intval($flushHeader))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data[]=%s,flushHeader=%d', __METHOD__, __LINE__, $seekPosition, gettype($data), intval($flushHeader))); throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -340,7 +340,7 @@ class BaseIndex extends BaseFrameworkSystem { * @throws UnsupportedOperationException If this method is called */ public function writeValueToFile ($groupId, $value) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -353,7 +353,7 @@ class BaseIndex extends BaseFrameworkSystem { * @return $data Gap position and length of the raw data */ public function writeDataToFreeGap ($groupId, $hash, $encoded) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',hash=' . $hash . ',encoded()=' . strlen($encoded)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',hash=' . $hash . ',encoded()=' . strlen($encoded)); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/index/file_stack/class_FileStackIndex.php b/inc/main/classes/index/file_stack/class_FileStackIndex.php index 5076d808..b1e04a96 100644 --- a/inc/main/classes/index/file_stack/class_FileStackIndex.php +++ b/inc/main/classes/index/file_stack/class_FileStackIndex.php @@ -64,7 +64,7 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable { */ public function addHashToIndex ($groupId, array $data) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gap=%d,length=%d - CALLED!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], $data[BaseFileStack::ARRAY_INDEX_GAP_POSITION], $data[BaseFileStack::ARRAY_INDEX_DATA_LENGTH])); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gap=%d,length=%d - CALLED!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], $data[BaseFileStack::ARRAY_INDEX_GAP_POSITION], $data[BaseFileStack::ARRAY_INDEX_DATA_LENGTH])); // Raw data been written to the file $rawData = sprintf('%s%s%s%s%s%s%s', @@ -78,7 +78,7 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable { ); // Debug message - /* 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))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->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)); @@ -87,13 +87,13 @@ class FileStackIndex extends BaseIndex implements IndexableStack, Registerable { assert($gapPosition > $this->getIteratorInstance()->getHeaderSize()); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gapPosition=%s', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], $gapPosition)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gapPosition=%s', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], $gapPosition)); // Then write the data at that gap $this->getIteratorInstance()->writeData($gapPosition, $rawData); // Debug message - /* 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))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d - EXIT!', __METHOD__, __LINE__, $groupId, $data[BaseFileStack::ARRAY_INDEX_HASH], strlen($rawData))); } /** diff --git a/inc/main/classes/iterator/file/class_FileIterator.php b/inc/main/classes/iterator/file/class_FileIterator.php index e28045cb..5b0c5cd8 100644 --- a/inc/main/classes/iterator/file/class_FileIterator.php +++ b/inc/main/classes/iterator/file/class_FileIterator.php @@ -46,7 +46,7 @@ class FileIterator extends BaseIterator implements SeekableWritableFileIterator $iteratorInstance = new FileIterator(); // Set the instance here - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d] Setting blockInstance=%s ...', __METHOD__, __LINE__, $blockInstance->__toString())); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d] Setting blockInstance=%s ...', __METHOD__, __LINE__, $blockInstance->__toString())); $iteratorInstance->setBlockInstance($blockInstance); // Return the prepared instance diff --git a/inc/main/classes/listener/class_BaseListener.php b/inc/main/classes/listener/class_BaseListener.php index 920819b7..ff89553e 100644 --- a/inc/main/classes/listener/class_BaseListener.php +++ b/inc/main/classes/listener/class_BaseListener.php @@ -84,7 +84,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { // We need to clear the error here if it is a resource if ($isServerSocket === TRUE) { // Clear the error - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[]=' . gettype($socketResource)); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('socketResource[]=' . gettype($socketResource)); socket_clear_error($socketResource); } // END - if @@ -268,7 +268,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { */ public function accept (Visitor $visitorInstance) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - CALLED!'); // Visit this listener $visitorInstance->visitListener($this); @@ -279,7 +279,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { } // END - if // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - EXIT!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - EXIT!'); } /** @@ -376,7 +376,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { default: // Everything else <> 0 // Unhandled error code detected, so first debug it because we may want to handle it like the others - self::createDebugInstance(__CLASS__)->debugOutput('BASE-HUB[' . __METHOD__ . ':' . __LINE__ . '] UNKNOWN ERROR CODE = ' . $errorCode . ', MESSAGE = ' . socket_strerror($errorCode)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-HUB[' . __METHOD__ . ':' . __LINE__ . '] UNKNOWN ERROR CODE = ' . $errorCode . ', MESSAGE = ' . socket_strerror($errorCode)); // Change it only in this class $errorName = BaseRawDataHandler::SOCKET_ERROR_UNKNOWN; @@ -396,7 +396,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { */ public function shutdownSocket ($socketResource) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-SYSTEM: Shutting down socket resource ' . $socketResource . ' with state ' . $this->getPrintableState() . ' ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-SYSTEM: Shutting down socket resource ' . $socketResource . ' with state ' . $this->getPrintableState() . ' ...'); // Set socket resource $this->setSocketResource($socketResource); @@ -405,7 +405,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { $visitorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_socket_visitor_class'); // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('HUB-SYSTEM:' . $this->__toString() . ': visitorInstance=' . $visitorInstance->__toString()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-SYSTEM:' . $this->__toString() . ': visitorInstance=' . $visitorInstance->__toString()); // Call the visitor $this->accept($visitorInstance); @@ -420,7 +420,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { */ public function halfShutdownSocket ($socketResource) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-SYSTEM: Half-shutting down socket resource ' . $socketResource . ' with state ' . $this->getPrintableState() . ' ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-SYSTEM: Half-shutting down socket resource ' . $socketResource . ' with state ' . $this->getPrintableState() . ' ...'); // Set socket resource $this->setSocketResource($socketResource); @@ -429,7 +429,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { $visitorInstance = ObjectFactory::createObjectByConfiguredName('half_shutdown_socket_visitor_class'); // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('HUB-SYSTEM:' . $this->__toString() . ': visitorInstance=' . $visitorInstance->__toString()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-SYSTEM:' . $this->__toString() . ': visitorInstance=' . $visitorInstance->__toString()); // Call the visitor $this->accept($visitorInstance); @@ -491,14 +491,14 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { // Some new peers found? if ($left < 1) { // Debug message - //* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: left=' . $left . ',serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE)); + //* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: left=' . $left . ',serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE)); // Nothing new found return; } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE)); // Do we have changed peers? if (in_array($this->getSocketResource(), $readers)) { @@ -512,7 +512,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { $newSocket = socket_accept($this->getSocketResource()); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: newSocket=' . $newSocket . ',serverSocket=' .$this->getSocketResource()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: newSocket=' . $newSocket . ',serverSocket=' .$this->getSocketResource()); // Array for timeout settings $options = array( @@ -532,7 +532,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { // Output result (only for debugging!) /* $option = socket_get_option($newSocket, SOL_SOCKET, SO_RCVTIMEO); - self::createDebugInstance(__CLASS__)->debugOutput('SO_RCVTIMEO[' . gettype($option) . ']=' . print_r($option, TRUE)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SO_RCVTIMEO[' . gettype($option) . ']=' . print_r($option, TRUE)); */ // Enable SO_OOBINLINE @@ -589,7 +589,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable { $currentSocket = $this->getIteratorInstance()->current(); // Handle it here, if not main server socket - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: currentSocket=' . $currentSocket[BasePool::SOCKET_ARRAY_RESOURCE] . ',type=' . $currentSocket[BasePool::SOCKET_ARRAY_CONN_TYPE] . ',serverSocket=' . $this->getSocketResource()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: currentSocket=' . $currentSocket[BasePool::SOCKET_ARRAY_RESOURCE] . ',type=' . $currentSocket[BasePool::SOCKET_ARRAY_CONN_TYPE] . ',serverSocket=' . $this->getSocketResource()); if (($currentSocket[BasePool::SOCKET_ARRAY_CONN_TYPE] != BaseConnectionHelper::CONNECTION_TYPE_SERVER) && ($currentSocket[BasePool::SOCKET_ARRAY_RESOURCE] != $this->getSocketResource())) { // ... or else it will raise warnings like 'Transport endpoint is not connected' $this->getHandlerInstance()->processRawDataFromResource($currentSocket); diff --git a/inc/main/classes/listener/class_BaseListenerDecorator.php b/inc/main/classes/listener/class_BaseListenerDecorator.php index adaa544a..93108652 100644 --- a/inc/main/classes/listener/class_BaseListenerDecorator.php +++ b/inc/main/classes/listener/class_BaseListenerDecorator.php @@ -127,7 +127,7 @@ class BaseListenerDecorator extends BaseDecorator implements Visitable { */ if (!$handlerInstance instanceof Networkable) { // Skip this silently for now. Later on, this will become mandatory! - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('No handler assigned to this listener decorator. this=' . $this->__toString() . ', listenerInstance=' . $this->getListenerInstance()->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('No handler assigned to this listener decorator. this=' . $this->__toString() . ', listenerInstance=' . $this->getListenerInstance()->__toString()); return; } // END - if @@ -147,7 +147,7 @@ class BaseListenerDecorator extends BaseDecorator implements Visitable { * know if the decoded data origins from a TCP or UDP connection so it * can just be passed over to the network package receiver. */ - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-LISTENER-DECORATOR[' . __METHOD__ . ':' . __LINE__ . '] Going to handle over some raw data to receiver instance (' . $receiverInstance->__toString() . ') ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LISTENER-DECORATOR[' . __METHOD__ . ':' . __LINE__ . '] Going to handle over some raw data to receiver instance (' . $receiverInstance->__toString() . ') ...'); $receiverInstance->addRawDataToIncomingStack($handlerInstance); } diff --git a/inc/main/classes/listener/socket/class_SocketFileListener.php b/inc/main/classes/listener/socket/class_SocketFileListener.php index eafa15c5..1b12a3a6 100644 --- a/inc/main/classes/listener/socket/class_SocketFileListener.php +++ b/inc/main/classes/listener/socket/class_SocketFileListener.php @@ -82,7 +82,7 @@ class SocketFileListener extends BaseListener implements Listenable { $socketFile = self::createTempPathForFile($this->getConfigInstance()->getConfigEntry('ipc_socket_file_name')); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: socketFile=' . $socketFile . ' ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: socketFile=' . $socketFile . ' ...'); // File name must not be empty assert(!empty($socketFile)); @@ -90,7 +90,7 @@ class SocketFileListener extends BaseListener implements Listenable { // Is the file there? if ((self::isReachableFilePath($socketFile)) && (file_exists($socketFile))) { // Old socket found - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: WARNING: Old socket at ' . $socketFile . ' found. Will not start.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: WARNING: Old socket at ' . $socketFile . ' found. Will not start.'); // Shutdown this socket $this->shutdownSocket($mainSocket); @@ -100,7 +100,7 @@ class SocketFileListener extends BaseListener implements Listenable { } // END - if // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Binding to ' . $socketFile . ' ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Binding to ' . $socketFile . ' ...'); // Try to bind to it if (!socket_bind($mainSocket, $socketFile)) { @@ -122,7 +122,7 @@ class SocketFileListener extends BaseListener implements Listenable { } // END - if // Start listen for connections - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Listening for connections.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Listening for connections.'); if (!socket_listen($mainSocket)) { // Handle this socket error with a faked recipientData array $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array($socketFile, '0')); @@ -142,7 +142,7 @@ class SocketFileListener extends BaseListener implements Listenable { } // END - if // Now, we want non-blocking mode - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Setting non-blocking mode.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Setting non-blocking mode.'); if (!socket_set_nonblock($mainSocket)) { // Handle this socket error with a faked recipientData array $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array($socketFile, '0')); @@ -187,7 +187,7 @@ class SocketFileListener extends BaseListener implements Listenable { $this->setHandlerInstance($handlerInstance); // Output message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Socket listener now ready on socket ' . $socketFile . ' for service.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Socket listener now ready on socket ' . $socketFile . ' for service.'); } /** diff --git a/inc/main/classes/lists/class_BaseList.php b/inc/main/classes/lists/class_BaseList.php index 5218382b..4c32332c 100644 --- a/inc/main/classes/lists/class_BaseList.php +++ b/inc/main/classes/lists/class_BaseList.php @@ -90,7 +90,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab * @return $isset Whether the group is valid */ public function isGroupSet ($groupName) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName); return isset($this->listGroups[$groupName]); } @@ -102,7 +102,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab * @throws ListGroupAlreadyAddedException If the given group is already added */ public function addGroup ($groupName) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!'); // Is the group already added? if ($this->isGroupSet($groupName)) { // Throw the exception here @@ -111,7 +111,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab // Add the group which is a simple array $this->listGroups[$groupName] = ObjectFactory::createObjectByConfiguredName('list_group_class'); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - EXIT!'); } /** @@ -125,7 +125,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab */ public function addInstance ($groupName, $subGroup, Visitable $visitableInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ',visitableInstance=' . $visitableInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ',visitableInstance=' . $visitableInstance->__toString() . ' - CALLED!'); // Is the group there? if (!$this->isGroupSet($groupName)) { @@ -143,10 +143,10 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab $hash = $this->generateHash($groupName, $subGroup, $visitableInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ',hash=' . $hash . ' - Calling addEntry() ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ',hash=' . $hash . ' - Calling addEntry() ...'); // Now add it to the group list and hash it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',this->listGroups[' . $groupName . ']=' . $this->listGroups[$groupName]->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',this->listGroups[' . $groupName . ']=' . $this->listGroups[$groupName]->__toString()); //$this->listGroups[$groupName]->addEntry($subGroup, $hash); // Add the hash to the index @@ -156,7 +156,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab $this->listEntries[$hash] = $visitableInstance; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ' - EXIT!'); } /** @@ -168,7 +168,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab */ public final function getArrayFromList ($list) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',list[' . gettype($list) . ']=' . $list . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',list[' . gettype($list) . ']=' . $list . ' - CALLED!'); // Is the group there? if ((!is_null($list)) && (!$this->isGroupSet($list))) { @@ -188,18 +188,18 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab // Walk through all entries foreach ($this->listIndex as $hash) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash); // Is the list entry set? if ($this->isHashValid($hash)) { // Add it array_push($array, $this->listEntries[$hash]); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash . ',array(' . count($array) . ')=' . print_r($array, TRUE) . ' - ADDED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash . ',array(' . count($array) . ')=' . print_r($array, TRUE) . ' - ADDED!'); } // END - if } // END - foreach // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',list[' . gettype($list) . ']=' . $list . ',array()=' . count($array) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',list[' . gettype($list) . ']=' . $list . ',array()=' . count($array) . ' - EXIT!'); // Return it return $array; @@ -215,7 +215,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab */ public function addEntry ($groupName, $entry) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!'); // Is the group already added? if (!$this->isGroupSet($groupName)) { @@ -227,19 +227,19 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab $hash = $this->generateHash($groupName, $groupName, $entry); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',entry=' . print_r($entry, TRUE) . ', hash=' . $hash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',entry=' . print_r($entry, TRUE) . ', hash=' . $hash); // Add the hash to the index array_push($this->listIndex, $hash); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',listEntries()=' . count($this->listEntries)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',listEntries()=' . count($this->listEntries)); // Now add the entry to the list $this->listEntries[$hash] = $entry; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',listEntries()=' . count($this->listEntries) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',listEntries()=' . count($this->listEntries) . ' - EXIT!'); } /** @@ -252,7 +252,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab */ public function removeEntry ($groupName, $entry) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!'); // Is the group already added? if (!$this->isGroupSet($groupName)) { @@ -264,7 +264,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab $hash = $this->generateHash($groupName, $groupName, $entry); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',entry=' . $entry . ', hash=' . $hash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',entry=' . $entry . ', hash=' . $hash); // Remove it from the list ... unset($this->listEntries[$hash]); @@ -273,7 +273,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab unset($this->listIndex[array_search($hash, $this->listIndex)]); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - EXIT!'); } /** @@ -308,7 +308,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab $entry2 = crc32($entry[BasePool::SOCKET_ARRAY_RESOURCE] . ':' . $entry[BasePool::SOCKET_ARRAY_CONN_TYPE]); } else { // Unsupported type detected - self::createDebugInstance(__CLASS__)->debugOutput('BASE-LIST[' . __METHOD__ . ':' . __LINE__ . ']: Entry type ' . gettype($entry) . ' is unsupported.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST[' . __METHOD__ . ':' . __LINE__ . ']: Entry type ' . gettype($entry) . ' is unsupported.'); // @TODO Extend this somehow? $entry2 = gettype($entry); @@ -452,7 +452,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab $entry = $this->getEntry($entryIndex); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('LIST: Adding entry ' . $entry . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LIST: Adding entry ' . $entry . ' ...'); // Add it to the list $entries[$iteratorInstance->current()] = $entry; diff --git a/inc/main/classes/menu/class_BaseMenu.php b/inc/main/classes/menu/class_BaseMenu.php index 5ce3f3fc..fb309963 100644 --- a/inc/main/classes/menu/class_BaseMenu.php +++ b/inc/main/classes/menu/class_BaseMenu.php @@ -71,7 +71,7 @@ class BaseMenu extends BaseFrameworkSystem { $templateInstance->loadMenuTemplate($command . '_menu_entries'); } catch (FileNotFoundException $e) { // Log exception @TODO Maybe to intrusive? - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: Exception caught: ' . $e->__toString() . ', with message: ' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: Exception caught: ' . $e->__toString() . ', with message: ' . $e->getMessage()); } // Render template data here diff --git a/inc/main/classes/output/console/class_ConsoleOutput.php b/inc/main/classes/output/console/class_ConsoleOutput.php index 372bd47d..d08c1324 100644 --- a/inc/main/classes/output/console/class_ConsoleOutput.php +++ b/inc/main/classes/output/console/class_ConsoleOutput.php @@ -118,7 +118,7 @@ class ConsoleOutput extends BaseOutput implements OutputStreamer { * @throws UnsupportedOperationException If this method is called */ public function seek ($offset, $whence = SEEK_SET) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/output/debug/console/class_DebugConsoleOutput.php b/inc/main/classes/output/debug/console/class_DebugConsoleOutput.php index 181248fe..8c0a749a 100644 --- a/inc/main/classes/output/debug/console/class_DebugConsoleOutput.php +++ b/inc/main/classes/output/debug/console/class_DebugConsoleOutput.php @@ -103,7 +103,7 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre * @throws UnsupportedOperationException If this method is called */ public function streamData ($data) { - self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -126,7 +126,7 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre * @throws UnsupportedOperationException If this method is called */ public function seek ($offset, $whence = SEEK_SET) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/output/debug/error/class_DebugErrorLogOutput.php b/inc/main/classes/output/debug/error/class_DebugErrorLogOutput.php index 464e266d..2ea7da73 100644 --- a/inc/main/classes/output/debug/error/class_DebugErrorLogOutput.php +++ b/inc/main/classes/output/debug/error/class_DebugErrorLogOutput.php @@ -99,7 +99,7 @@ class DebugErrorLogOutput extends BaseDebugOutput implements Debugger, OutputStr * @throws UnsupportedOperationException If this method is called */ public function streamData ($data) { - self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -122,7 +122,7 @@ class DebugErrorLogOutput extends BaseDebugOutput implements Debugger, OutputStr * @throws UnsupportedOperationException If this method is called */ public function seek ($offset, $whence = SEEK_SET) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/output/debug/web/class_DebugWebOutput.php b/inc/main/classes/output/debug/web/class_DebugWebOutput.php index ff003f66..4093172a 100644 --- a/inc/main/classes/output/debug/web/class_DebugWebOutput.php +++ b/inc/main/classes/output/debug/web/class_DebugWebOutput.php @@ -88,7 +88,7 @@ class DebugWebOutput extends BaseDebugOutput implements Debugger, OutputStreamer * @throws UnsupportedOperationException If this method is called */ public function streamData ($data) { - self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -111,7 +111,7 @@ class DebugWebOutput extends BaseDebugOutput implements Debugger, OutputStreamer * @throws UnsupportedOperationException If this method is called */ public function seek ($offset, $whence = SEEK_SET) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/output/web/class_WebOutput.php b/inc/main/classes/output/web/class_WebOutput.php index b5dce668..e1299ef1 100644 --- a/inc/main/classes/output/web/class_WebOutput.php +++ b/inc/main/classes/output/web/class_WebOutput.php @@ -103,7 +103,7 @@ class WebOutput extends BaseOutput implements OutputStreamer, Registerable { * @throws UnsupportedOperationException If this method is called */ public function seek ($offset, $whence = SEEK_SET) { - self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/parser/xml/class_XmlParser.php b/inc/main/classes/parser/xml/class_XmlParser.php index 44c28441..318e344b 100644 --- a/inc/main/classes/parser/xml/class_XmlParser.php +++ b/inc/main/classes/parser/xml/class_XmlParser.php @@ -71,9 +71,9 @@ class XmlParser extends BaseParser implements Parseable { // Convert all to UTF8 if (empty($content)) { // No empty content! - self::createDebugInstance(__CLASS__)->debugOutput('Empty content! Backtrace:
');
+			self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Empty content! Backtrace: 
');
 			debug_print_backtrace();
-			self::createDebugInstance(__CLASS__)->debugOutput('
'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('
'); exit(); } elseif (function_exists('recode')) { // Recode found, so use it diff --git a/inc/main/classes/registry/class_BaseRegistry.php b/inc/main/classes/registry/class_BaseRegistry.php index 9e7617f4..9d47a9a1 100644 --- a/inc/main/classes/registry/class_BaseRegistry.php +++ b/inc/main/classes/registry/class_BaseRegistry.php @@ -140,12 +140,12 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable { $entry = array(); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Checking arrayKey=' . $arrayKey . ',lookFor=' . $lookFor); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Checking arrayKey=' . $arrayKey . ',lookFor=' . $lookFor); // "Walk" over all entries foreach ($this->getEntries($arrayKey) as $key => $value) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Checking key=' . $key . ',value=' . $value . ',lookFor=' . $lookFor); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Checking key=' . $key . ',value=' . $value . ',lookFor=' . $lookFor); // If $value matches the $lookFor, we need to look for more entries for this! if ($lookFor == $value) { @@ -154,7 +154,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable { // Now "walk" through all entries, if an array is returned if (is_array($value2)) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Checking key2=' . $key2 . ',value2()=' . count($value2) . ',lookFor=' . $lookFor); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Checking key2=' . $key2 . ',value2()=' . count($value2) . ',lookFor=' . $lookFor); // "Walk" through all of them foreach ($value2 as $key3 => $value3) { @@ -162,12 +162,12 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable { assert(is_array($value3)); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Checking key=' . $key . ',key3=' . $key3 . ',isset()=' . isset($value3[$key]) . ' ...'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Checking key=' . $key . ',key3=' . $key3 . ',isset()=' . isset($value3[$key]) . ' ...'); // Both keys must match! if (($key == $key3) || (isset($value3[$key]))) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . $value3[$key] . ' ...'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . $value3[$key] . ' ...'); // Then add it $entry[$key3] = $value3[$key]; @@ -182,7 +182,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable { } // END - foreach // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Returning entry(' . count($entry) . ')=' . print_r($entry, TRUE)); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Returning entry(' . count($entry) . ')=' . print_r($entry, TRUE)); // Return it return $entry; diff --git a/inc/main/classes/resolver/controller/class_BaseControllerResolver.php b/inc/main/classes/resolver/controller/class_BaseControllerResolver.php index e78aa7a1..38b81240 100644 --- a/inc/main/classes/resolver/controller/class_BaseControllerResolver.php +++ b/inc/main/classes/resolver/controller/class_BaseControllerResolver.php @@ -60,7 +60,7 @@ class BaseControllerResolver extends BaseResolver { $this->setClassName($this->getCapitalizedClassPrefix() . 'DefaultNewsController'); // Generate the class name - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BEFORE: controller=' . $controllerName); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BEFORE: controller=' . $controllerName); if ($controllerName != $defaultController) { // Create controller class name $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($controllerName) . 'Controller'; @@ -71,7 +71,7 @@ class BaseControllerResolver extends BaseResolver { // No news at main controller or non-news controller $this->setClassName($this->getCapitalizedClassPrefix() . 'DefaultNewsController'); } - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('AFTER: controller=' . $this->getClassName()); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('AFTER: controller=' . $this->getClassName()); // Is this class loaded? if (!class_exists($this->getClassName())) { diff --git a/inc/main/classes/response/class_BaseResponse.php b/inc/main/classes/response/class_BaseResponse.php index 6e1e5cf2..d0925c14 100644 --- a/inc/main/classes/response/class_BaseResponse.php +++ b/inc/main/classes/response/class_BaseResponse.php @@ -198,7 +198,7 @@ class BaseResponse extends BaseFrameworkSystem { // Send all headers foreach ($this->responseHeaders as $name => $value) { header($name . ': ' . $value); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('name=' . $name . ',value=' . $value); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('name=' . $name . ',value=' . $value); } // END - foreach // Send cookies out? diff --git a/inc/main/classes/stacker/file/class_BaseFileStack.php b/inc/main/classes/stacker/file/class_BaseFileStack.php index e51b1b8a..dd446e62 100644 --- a/inc/main/classes/stacker/file/class_BaseFileStack.php +++ b/inc/main/classes/stacker/file/class_BaseFileStack.php @@ -66,23 +66,23 @@ class BaseFileStack extends BaseStacker { * @todo To hard assertions here, better rewrite them to exceptions */ public function readFileHeader () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // First rewind to beginning as the header sits at the beginning ... $this->getIteratorInstance()->rewind(); // Then read it (see constructor for calculation) $data = $this->getIteratorInstance()->read($this->getIteratorInstance()->getHeaderSize()); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Read %d bytes (%d wanted).', __METHOD__, __LINE__, strlen($data), $this->getIteratorInstance()->getHeaderSize())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Read %d bytes (%d wanted).', __METHOD__, __LINE__, strlen($data), $this->getIteratorInstance()->getHeaderSize())); // Have all requested bytes been read? assert(strlen($data) == $this->getIteratorInstance()->getHeaderSize()); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Last character must be the separator - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] data(-1)=%s', __METHOD__, __LINE__, dechex(ord(substr($data, -1, 1))))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] data(-1)=%s', __METHOD__, __LINE__, dechex(ord(substr($data, -1, 1))))); assert(substr($data, -1, 1) == chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES)); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Okay, then remove it $data = substr($data, 0, -1); @@ -103,25 +103,25 @@ class BaseFileStack extends BaseStacker { $this->getIteratorInstance()->setHeader($header); // Check if the array has only 3 elements - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, TRUE))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, TRUE))); assert(count($header) == 3); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Check magic assert($header[0] == self::STACK_MAGIC); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Check length of count and seek position assert(strlen($header[1]) == BaseBinaryFile::LENGTH_COUNT); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); assert(strlen($header[2]) == BaseBinaryFile::LENGTH_POSITION); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__)); // Decode count and seek position $header[1] = hex2bin($header[1]); $header[2] = hex2bin($header[2]); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -130,7 +130,7 @@ class BaseFileStack extends BaseStacker { * @return void */ public function flushFileHeader () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__)); // Put all informations together $header = sprintf('%s%s%s%s%s%s', @@ -156,7 +156,7 @@ class BaseFileStack extends BaseStacker { // Write it to disk (header is always at seek position 0) $this->getIteratorInstance()->writeData(0, $header, FALSE); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__)); } /** @@ -234,7 +234,7 @@ class BaseFileStack extends BaseStacker { } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); // No objects/resources are allowed as their serialization takes to long assert(!is_object($value)); @@ -530,7 +530,7 @@ class BaseFileStack extends BaseStacker { * @throws UnsupportedOperationException This method is not (and maybe never will be) supported */ public function writeData ($seekPosition, $data, $flushHeader = TRUE) { - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data[]=%s,flushHeader=%d', __METHOD__, __LINE__, $seekPosition, gettype($data), intval($flushHeader))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data[]=%s,flushHeader=%d', __METHOD__, __LINE__, $seekPosition, gettype($data), intval($flushHeader))); throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -543,7 +543,7 @@ class BaseFileStack extends BaseStacker { * @throws UnsupportedOperationException This method is not (and maybe never will be) supported */ public function writeValueToFile ($groupId, $value) { - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,value[%s]=%s', __METHOD__, __LINE__, $groupId, gettype($value), print_r($value, TRUE))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,value[%s]=%s', __METHOD__, __LINE__, $groupId, gettype($value), print_r($value, TRUE))); throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -556,7 +556,7 @@ class BaseFileStack extends BaseStacker { * @throws UnsupportedOperationException This method is not (and maybe never will be) supported */ public function searchNextGap ($length) { - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] length=%s', __METHOD__, __LINE__, $length)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] length=%s', __METHOD__, __LINE__, $length)); throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION); } @@ -580,7 +580,7 @@ class BaseFileStack extends BaseStacker { */ public function writeDataToFreeGap ($groupId, $hash, $encoded) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,encoded()=%d - CALLED!', __METHOD__, __LINE__, $groupId, $hash, strlen($encoded))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->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', @@ -592,7 +592,7 @@ class BaseFileStack extends BaseStacker { ); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d', __METHOD__, __LINE__, $groupId, $hash, strlen($rawData))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->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)); @@ -601,13 +601,13 @@ class BaseFileStack extends BaseStacker { assert($gapPosition > $this->getIteratorInstance()->getHeaderSize()); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gapPosition=%s', __METHOD__, __LINE__, $groupId, $hash, $gapPosition)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,gapPosition=%s', __METHOD__, __LINE__, $groupId, $hash, $gapPosition)); // Then write the data at that gap $this->getIteratorInstance()->writeData($gapPosition, $rawData); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] groupId=%s,hash=%s,rawData()=%d - EXIT!', __METHOD__, __LINE__, $groupId, $hash, strlen($rawData))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->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( diff --git a/inc/main/classes/streams/crypto/class_McryptStream.php b/inc/main/classes/streams/crypto/class_McryptStream.php index 2535f812..f614d0d3 100644 --- a/inc/main/classes/streams/crypto/class_McryptStream.php +++ b/inc/main/classes/streams/crypto/class_McryptStream.php @@ -67,7 +67,7 @@ class McryptStream extends BaseStream implements EncryptableStream { */ public function encryptStream ($str, $key = NULL) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: key[' . gettype($key) . ']=' . $key); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: key[' . gettype($key) . ']=' . $key); // Init crypto module $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); @@ -170,7 +170,7 @@ class McryptStream extends BaseStream implements EncryptableStream { * @throws UnsupportedOperationException If this method is called (which is a mistake) */ public function streamData ($data) { - self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/streams/crypto/class_NullCryptoStream.php b/inc/main/classes/streams/crypto/class_NullCryptoStream.php index a2f33c2c..9f26c9c3 100644 --- a/inc/main/classes/streams/crypto/class_NullCryptoStream.php +++ b/inc/main/classes/streams/crypto/class_NullCryptoStream.php @@ -86,7 +86,7 @@ class NullCryptoStream extends BaseStream implements EncryptableStream { * @throws UnsupportedOperationException If this method is called (which is a mistake) */ public function streamData ($data) { - self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/inc/main/classes/tasks/idle/class_IdleLoopTask.php b/inc/main/classes/tasks/idle/class_IdleLoopTask.php index 186cbf0c..a8bba354 100644 --- a/inc/main/classes/tasks/idle/class_IdleLoopTask.php +++ b/inc/main/classes/tasks/idle/class_IdleLoopTask.php @@ -84,7 +84,7 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable { */ public function doShutdown () { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/inc/main/classes/template/class_BaseTemplateEngine.php b/inc/main/classes/template/class_BaseTemplateEngine.php index d507052a..a20fa8c6 100644 --- a/inc/main/classes/template/class_BaseTemplateEngine.php +++ b/inc/main/classes/template/class_BaseTemplateEngine.php @@ -194,7 +194,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // If the stack is NULL, use the current group if (is_null($variableGroup)) { // Use current group - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!'); $variableGroup = $this->currGroup; } // END - if @@ -202,11 +202,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem { if ($this->isVarStackSet($variableGroup)) { // Now search for it foreach ($this->getVarStack($variableGroup) as $index => $currEntry) { - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.':currGroup=' . $variableGroup . ',idx=' . $index . ',currEntry=' . $currEntry['name'] . ',variableName=' . $variableName); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.':currGroup=' . $variableGroup . ',idx=' . $index . ',currEntry=' . $currEntry['name'] . ',variableName=' . $variableName); // Is the entry found? if ($currEntry['name'] == $variableName) { // Found! - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.':FOUND!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.':FOUND!'); $found = $index; break; } // END - if @@ -269,7 +269,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // If the stack is NULL, use the current group if (is_null($variableGroup)) { // Use current group - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!'); $variableGroup = $this->currGroup; } // END - if @@ -283,7 +283,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { } // END - if // Return the current position - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': variableGroup=' . $variableGroup . ',variableName=' . $variableName . ', content[' . gettype($content) . ']=' . $content); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': variableGroup=' . $variableGroup . ',variableName=' . $variableName . ', content[' . gettype($content) . ']=' . $content); return $content; } @@ -330,7 +330,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ public function setVariableGroup ($groupName, $add = TRUE) { // Set group name - //* DEBIG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': currGroup=' . $groupName); + //* DEBIG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': currGroup=' . $groupName); $this->currGroup = $groupName; // Skip group 'general' @@ -352,7 +352,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $variableName = trim(self::convertDashesToUnderscores($variableName)); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': group=' . $this->currGroup . ', variableName=' . $variableName . ', value=' . $value); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': group=' . $this->currGroup . ', variableName=' . $variableName . ', value=' . $value); // Get current variables in group $currVars = $this->readCurrentGroup(); @@ -628,8 +628,8 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ protected final function setRawTemplateData ($rawTemplateData) { // And store it in this class - //* 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)); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': ' . strlen($rawTemplateData) . ' Bytes set.'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': ' . $this->currGroup . ' variables: ' . count($this->getVarStack($this->currGroup)) . ', groups=' . count($this->varStack)); $this->rawTemplateData = (string) $rawTemplateData; } @@ -639,7 +639,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * @return $rawTemplateData The raw data from the template */ public final function getRawTemplateData () { - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: ' . strlen($this->rawTemplateData) . ' Bytes read.'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: ' . strlen($this->rawTemplateData) . ' Bytes read.'); return $this->rawTemplateData; } @@ -650,7 +650,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ private final function setCompiledData ($compiledData) { // And store it in this class - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: ' . strlen($compiledData) . ' Bytes set.'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: ' . strlen($compiledData) . ' Bytes set.'); $this->compiledData = (string) $compiledData; } @@ -660,7 +660,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * @return $compiledData Compiled template data */ public final function getCompiledData () { - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: ' . strlen($this->compiledData) . ' Bytes read.'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: ' . strlen($this->compiledData) . ' Bytes read.'); return $this->compiledData; } @@ -724,7 +724,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ private function loadRawTemplateData ($fqfn) { // Some debug code to look on the file which is being loaded - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: FQFN=' . $fqfn); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: FQFN=' . $fqfn); // Load the raw template $rawTemplateData = $this->getFileIoInstance()->loadFileContents($fqfn); @@ -750,7 +750,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $variableName = trim(self::convertDashesToUnderscores($variableName)); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: variableName=' . $variableName . ',variableName=' . $variableName); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: variableName=' . $variableName . ',variableName=' . $variableName); // Is it not a config variable? if ($variableName != 'config') { @@ -776,7 +776,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { preg_match_all('/\$(\w+)(\[(\w+)\])?/', $rawData, $variableMatches); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: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)) { @@ -825,7 +825,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // RECURSIVE PROTECTION! BE CAREFUL HERE! if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:template=' . $template); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:template=' . $template); // Template not found, but maybe variable assigned? if ($this->getVariableIndex($template) !== FALSE) { @@ -960,7 +960,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ private function assignAllVariables (array $varMatches) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varMatches()=' . count($varMatches)); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varMatches()=' . count($varMatches)); // Search for all variables foreach ($varMatches[1] as $key => $var) { @@ -968,7 +968,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $var = trim(self::convertDashesToUnderscores($var)); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:key=' . $key . ',var=' . $var); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:key=' . $key . ',var=' . $var); // Detect leading equals if (substr($varMatches[2][$key], 0, 1) == '=') { @@ -995,19 +995,19 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ private function compileRawTemplateData (array $templateMatches) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:loadedRawData()= ' .count($this->loadedRawData)); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: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 - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:template=' . $template . ',code(' . strlen($code) . ')=' . $code); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:template=' . $template . ',code(' . strlen($code) . ')=' . $code); // Is this template already compiled? if (in_array($template, $this->compiledTemplates)) { // Then skip it - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: Template ' . $template . ' already compiled. SKIPPED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: Template ' . $template . ' already compiled. SKIPPED!'); continue; } // END - if @@ -1018,7 +1018,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); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varMatches=' . print_r($varMatches, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varMatches=' . print_r($varMatches, TRUE)); // Assign all variables $this->assignAllVariables($varMatches); @@ -1054,7 +1054,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { private function finalizeVariableCompilation () { // Get the content $content = $this->getRawTemplateData(); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: content before=' . strlen($content) . ' (' . md5($content) . ')'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: content before=' . strlen($content) . ' (' . md5($content) . ')'); // Do we have the stack? if (!$this->isVarStackSet('general')) { @@ -1065,7 +1065,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Walk through all variables foreach ($this->getVarStack('general') as $currEntry) { - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: name=' . $currEntry['name'] . ', value=
' . htmlentities($currEntry['value']) . '
'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: name=' . $currEntry['name'] . ', value=
' . htmlentities($currEntry['value']) . '
'); // Replace all [$var] or {?$var?} with the content // @TODO Old behaviour, will become obsolete! $content = str_replace('$content[' . $currEntry['name'] . ']', $currEntry['value'], $content); @@ -1077,7 +1077,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $content = str_replace('{?' . $currEntry['name'] . '?}', $currEntry['value'], $content); } // END - for - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: content after=' . strlen($content) . ' (' . md5($content) . ')'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: content after=' . strlen($content) . ' (' . md5($content) . ')'); // Set the content back $this->setRawTemplateData($content); @@ -1122,11 +1122,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Was it found? if ($index === FALSE) { // Add it to the stack - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:ADD: ' . $variableName . '[' . gettype($value) . ']=' . $value); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:ADD: ' . $variableName . '[' . gettype($value) . ']=' . $value); $this->addVariable($variableName, $value); } elseif (!empty($value)) { // Modify the stack entry - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:MOD: ' . $variableName . '[' . gettype($value) . ']=' . $value); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:MOD: ' . $variableName . '[' . gettype($value) . ']=' . $value); $this->modifyVariable($variableName, $value); } } @@ -1145,7 +1145,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Was it found? if ($index !== FALSE) { // Remove this variable - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:UNSET: variableGroup=' . $variableGroup . ',variableName=' . $variableName . ',index=' . $index); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:UNSET: variableGroup=' . $variableGroup . ',variableName=' . $variableName . ',index=' . $index); $this->unsetVariableStackOffset($index, $variableGroup); } // END - if } @@ -1179,7 +1179,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $variableName = trim(self::convertDashesToUnderscores($variableName)); // Sweet and simple... - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: variableName=' . $variableName . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($variableName)); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: variableName=' . $variableName . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($variableName)); $this->assignVariable($variableName, $this->getConfigInstance()->getConfigEntry($variableName)); } @@ -1262,7 +1262,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Do we have the stack? if (!$this->isVarStackSet('general')) { // Abort here silently - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: Aborted, variable stack general not found!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: Aborted, variable stack general not found!'); return; } // END - if @@ -1272,11 +1272,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $value = $this->compileRawCode($this->readVariable($currVariable['name']), TRUE); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: name=' . $currVariable['name'] . ',value=' . $value); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: name=' . $currVariable['name'] . ',value=' . $value); // Remove it from stack $this->removeVariable($currVariable['name'], 'general'); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: value='. $value . ',name=' . $currVariable['name'] . ',index=' . $index); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: value='. $value . ',name=' . $currVariable['name'] . ',index=' . $index); // Is it a configuration key? if ($this->getConfigInstance()->isConfigurationEntrySet($value)) { @@ -1303,7 +1303,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 - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:' . $currVariable['name'] . '=
' . htmlentities($currVariable['value']).'
'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:' . $currVariable['name'] . '=
' . htmlentities($currVariable['value']).'
'); $dummy[$currVariable['name']] = $currVariable['value']; }// END - if @@ -1360,7 +1360,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Goes something wrong? if ((!isset($result)) || (empty($result))) { // Output eval command - self::createDebugInstance(__CLASS__)->debugOutput(sprintf('Failed eval() code:
%s
', $this->markupCode($eval, TRUE)), TRUE); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Failed eval() code:
%s
', $this->markupCode($eval, TRUE)), TRUE); // Output backtrace here $this->debugBackTrace(); @@ -1410,7 +1410,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { preg_match_all($this->regExpCodeTags, $rawData, $templateMatches); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:templateMatches=' . print_r($templateMatches , TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:templateMatches=' . print_r($templateMatches , TRUE)); // Analyze the matches array if ((is_array($templateMatches)) && (count($templateMatches) == 4) && (count($templateMatches[0]) > 0)) { @@ -1476,22 +1476,22 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ public function compileRawCode ($rawCode, $setMatchAsCode=FALSE) { // Find the variables - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:rawCode=
' . htmlentities($rawCode) . '
'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:rawCode=
' . htmlentities($rawCode) . '
'); preg_match_all($this->regExpVarValue, $rawCode, $varMatches); // Compile all variables - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:
' . print_r($varMatches, TRUE) . '
'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:
' . print_r($varMatches, TRUE) . '
'); foreach ($varMatches[0] as $match) { // Add variable tags around it $varCode = '{?' . $match . '?}'; // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varCode=' . $varCode); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varCode=' . $varCode); // Is the variable found in code? (safes some calls) if (strpos($rawCode, $varCode) !== FALSE) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',rawCode[' . gettype($rawCode) . ']=' . $rawCode); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',rawCode[' . gettype($rawCode) . ']=' . $rawCode); // Use $match as new value or $value from read variable? if ($setMatchAsCode === TRUE) { @@ -1508,7 +1508,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { } // END - foreach // Return the compiled data - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:rawCode=
' . htmlentities($rawCode) . '
'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:rawCode=
' . htmlentities($rawCode) . '
'); return $rawCode; } @@ -1529,7 +1529,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * @return void */ public function renameVariable ($oldName, $newName) { - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: oldName=' . $oldName . ', newName=' . $newName); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: oldName=' . $oldName . ', newName=' . $newName); // Get raw template code $rawData = $this->getRawTemplateData(); diff --git a/inc/main/classes/visitor/tasks/class_ActiveTaskVisitor.php b/inc/main/classes/visitor/tasks/class_ActiveTaskVisitor.php index 7df391ab..5ef8686a 100644 --- a/inc/main/classes/visitor/tasks/class_ActiveTaskVisitor.php +++ b/inc/main/classes/visitor/tasks/class_ActiveTaskVisitor.php @@ -59,9 +59,9 @@ class ActiveTaskVisitor extends BaseVisitor implements TaskVisitor, PoolVisitor, */ public function visitTask (Taskable $taskInstance) { // Execute the task from this visitor - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting task ' . $taskInstance->__toString() . ' - CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting task ' . $taskInstance->__toString() . ' - CALLED!'); $taskInstance->executeTask(); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting task ' . $taskInstance->__toString() . ' - EXIT!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting task ' . $taskInstance->__toString() . ' - EXIT!'); } /** @@ -86,9 +86,9 @@ class ActiveTaskVisitor extends BaseVisitor implements TaskVisitor, PoolVisitor, */ public function visitListener (Listenable $listenerInstance) { // Do "listen" here - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting ' . $listenerInstance->__toString() . ' - CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting ' . $listenerInstance->__toString() . ' - CALLED!'); $listenerInstance->doListen(); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting ' . $listenerInstance->__toString() . ' - FINISH'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting ' . $listenerInstance->__toString() . ' - FINISH'); } /** diff --git a/inc/main/middleware/compressor/class_CompressorChannel.php b/inc/main/middleware/compressor/class_CompressorChannel.php index 726969a8..fe77ed38 100644 --- a/inc/main/middleware/compressor/class_CompressorChannel.php +++ b/inc/main/middleware/compressor/class_CompressorChannel.php @@ -70,7 +70,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable { // Read all directories but no sub directories, .htaccess files and NullCompressor class while ($directoryEntry = $directoryInstance->readDirectoryExcept(array('.htaccess', 'class_NullCompressor.php'))) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('COMPRESSOR[' . __METHOD__ . ':' . __LINE__ . ']: directoryEntry=' . $directoryEntry); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COMPRESSOR[' . __METHOD__ . ':' . __LINE__ . ']: directoryEntry=' . $directoryEntry); // Is this a class file? if ((substr($directoryEntry, 0, 6) == 'class_') && (substr($directoryEntry, -4, 4) == '.php')) { diff --git a/inc/main/middleware/database/class_DatabaseConnection.php b/inc/main/middleware/database/class_DatabaseConnection.php index 03712ce5..fb02a790 100644 --- a/inc/main/middleware/database/class_DatabaseConnection.php +++ b/inc/main/middleware/database/class_DatabaseConnection.php @@ -217,10 +217,10 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re $this->dbLayer->connectToDatabase(); // Call database backend - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: Calling this->dbLayer->removeNonPublicDataFromArray(data) ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: Calling this->dbLayer->removeNonPublicDataFromArray(data) ...'); $data = $this->dbLayer->removeNonPublicDataFromArray($data); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: data[]=' . gettype($data)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: data[]=' . gettype($data)); return $data; } diff --git a/inc/main/middleware/io/class_FileIoHandler.php b/inc/main/middleware/io/class_FileIoHandler.php index 75d0af5e..effae7ad 100644 --- a/inc/main/middleware/io/class_FileIoHandler.php +++ b/inc/main/middleware/io/class_FileIoHandler.php @@ -133,7 +133,7 @@ class FileIoHandler extends BaseMiddleware implements IoHandler { * @throws UnsupportedOperationException If this method is called */ public function saveFile ($fileName, array $dataArray) { - self::createDebugInstance(__CLASS__)->debugOutput('fileName=' . $fileName . ',dataArray()=' . count($dataArray)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('fileName=' . $fileName . ',dataArray()=' . count($dataArray)); throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); }