From: Roland Häder Date: Thu, 18 May 2017 21:22:43 +0000 (+0200) Subject: Next wave: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4e38befe847e29e09d7f53facb2bb777c2c1d515;p=hub.git Next wave: - also log line number Signed-off-by: Roland Häder --- diff --git a/application/hub/class_ApplicationHelper.php b/application/hub/class_ApplicationHelper.php index c5ef21200..e557efd9b 100644 --- a/application/hub/class_ApplicationHelper.php +++ b/application/hub/class_ApplicationHelper.php @@ -212,6 +212,9 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Get default command $commandName = $responseInstance->determineDefaultCommand(); + // Debug message + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('commandName[%s]=%s', gettype($commandName), $commandName)); + // Set it in request $requestInstance->setRequestElement('command', $commandName); } // END - if @@ -240,9 +243,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.)'); } // END - if } diff --git a/application/hub/classes/apt-proxy/console/class_NodeConsoleAptProxy.php b/application/hub/classes/apt-proxy/console/class_NodeConsoleAptProxy.php index 06c91a534..66ba7274a 100644 --- a/application/hub/classes/apt-proxy/console/class_NodeConsoleAptProxy.php +++ b/application/hub/classes/apt-proxy/console/class_NodeConsoleAptProxy.php @@ -67,14 +67,14 @@ class NodeConsoleAptProxy extends BaseNodeAptProxy implements AptProxy, Register $app = $this->getApplicationInstance(); // Output all lines - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - An apt-proxy connection helper'); - self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2012 Apt-Proxy Developer Team'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); - self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); - self::createDebugInstance(__CLASS__)->debugOutput('conditions; see docs/COPYING for details.'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - An apt-proxy connection helper'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Copyright (c) 2012 Apt-Proxy Developer Team'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('conditions; see docs/COPYING for details.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); } /** diff --git a/application/hub/classes/chains/class_PackageFilterChain.php b/application/hub/classes/chains/class_PackageFilterChain.php index c79b62ef9..34ac967bb 100644 --- a/application/hub/classes/chains/class_PackageFilterChain.php +++ b/application/hub/classes/chains/class_PackageFilterChain.php @@ -61,7 +61,7 @@ class PackageFilterChain extends FilterChain { $filterInstance->processMessage($messageData, $packageInstance); } 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 @@ -82,7 +82,7 @@ class PackageFilterChain extends FilterChain { $filterInstance->postProcessMessage($packageInstance); } 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/application/hub/classes/chat/console/class_NodeConsoleChat.php b/application/hub/classes/chat/console/class_NodeConsoleChat.php index bdfbaec76..c7f28e361 100644 --- a/application/hub/classes/chat/console/class_NodeConsoleChat.php +++ b/application/hub/classes/chat/console/class_NodeConsoleChat.php @@ -67,14 +67,14 @@ class NodeConsoleChat extends BaseNodeChat implements Chatter, Registerable { $app = $this->getApplicationInstance(); // Output all lines - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - A telnet connection helper'); - self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2012 Chat Developer Team'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); - self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); - self::createDebugInstance(__CLASS__)->debugOutput('conditions; see docs/COPYING for details.'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - A telnet connection helper'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Copyright (c) 2012 Chat Developer Team'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('conditions; see docs/COPYING for details.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); } /** diff --git a/application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php b/application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php index ff7c46385..69d47c487 100644 --- a/application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php @@ -67,9 +67,9 @@ class HubConsoleAptProxyCommand extends BaseCommand implements Commandable { * extra arguments which mostly override config entries or enable special * features within the hub (none is ready at this development stage) */ - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); // Get apt-proxy instance $proxyInstance = Registry::getRegistry()->getInstance('apt_proxy'); @@ -81,7 +81,7 @@ class HubConsoleAptProxyCommand extends BaseCommand implements Commandable { $handlerInstance = Registry::getRegistry()->getInstance('task_handler'); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Entering main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Entering main loop. ---'); /* * ----------------------------- Main loop ---------------------------- @@ -95,7 +95,7 @@ class HubConsoleAptProxyCommand extends BaseCommand implements Commandable { } // END - while // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Leaving main loop. ---'); } /** diff --git a/application/hub/classes/commands/console/class_HubConsoleChatCommand.php b/application/hub/classes/commands/console/class_HubConsoleChatCommand.php index 84776e332..51a864853 100644 --- a/application/hub/classes/commands/console/class_HubConsoleChatCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleChatCommand.php @@ -67,9 +67,9 @@ class HubConsoleChatCommand extends BaseCommand implements Commandable { * extra arguments which mostly override config entries or enable special * features within the hub (none is ready at this development stage) */ - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); // Get chat instance $chatInstance = Registry::getRegistry()->getInstance('chat'); @@ -81,7 +81,7 @@ class HubConsoleChatCommand extends BaseCommand implements Commandable { $handlerInstance = Registry::getRegistry()->getInstance('task_handler'); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Entering main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Entering main loop. ---'); /* * ----------------------------- Main loop ---------------------------- @@ -95,7 +95,7 @@ class HubConsoleChatCommand extends BaseCommand implements Commandable { } // END - while // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Leaving main loop. ---'); } /** diff --git a/application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php b/application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php index 1f7d1c704..18056b528 100644 --- a/application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php @@ -67,9 +67,9 @@ class HubConsoleCrawlerCommand extends BaseCommand implements Commandable { * extra arguments which mostly override config entries or enable special * features within the hub (none is ready at this development stage) */ - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); // Get crawler instance $crawlerInstance = Registry::getRegistry()->getInstance('crawler'); @@ -81,7 +81,7 @@ class HubConsoleCrawlerCommand extends BaseCommand implements Commandable { $handlerInstance = Registry::getRegistry()->getInstance('task_handler'); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Entering main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Entering main loop. ---'); /* * ----------------------------- Main loop ---------------------------- @@ -95,7 +95,7 @@ class HubConsoleCrawlerCommand extends BaseCommand implements Commandable { } // END - while // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Leaving main loop. ---'); } /** diff --git a/application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php b/application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php index c1a6d0991..81caf05da 100644 --- a/application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php @@ -67,9 +67,9 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable { * extra arguments which mostly override config entries or enable special * features within the hub (none is ready at this development stage) */ - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); // Get cruncher instance $cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); @@ -81,7 +81,7 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable { $handlerInstance = Registry::getRegistry()->getInstance('task_handler'); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Entering main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Entering main loop. ---'); /* * ----------------------------- Main loop ---------------------------- @@ -95,7 +95,7 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable { } // END - while // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Leaving main loop. ---'); } /** diff --git a/application/hub/classes/commands/console/class_HubConsoleMainCommand.php b/application/hub/classes/commands/console/class_HubConsoleMainCommand.php index e92324a3c..5542de8a7 100644 --- a/application/hub/classes/commands/console/class_HubConsoleMainCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleMainCommand.php @@ -67,9 +67,9 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { * extra arguments which mostly override config entries or enable special * features within the hub (none is ready at this development stage) */ - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); // Get node instance $nodeInstance = NodeObjectFactory::createNodeInstance(); @@ -88,7 +88,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { $handlerInstance = Registry::getRegistry()->getInstance('task_handler'); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Entering main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Entering main loop. ---'); /* * ----------------------------- Main loop ---------------------------- @@ -102,7 +102,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { } // END - while // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Leaving main loop. ---'); } /** diff --git a/application/hub/classes/commands/console/class_HubConsoleMinerCommand.php b/application/hub/classes/commands/console/class_HubConsoleMinerCommand.php index 83aaf6369..e7c28d474 100644 --- a/application/hub/classes/commands/console/class_HubConsoleMinerCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleMinerCommand.php @@ -67,9 +67,9 @@ class HubConsoleMinerCommand extends BaseCommand implements Commandable { * extra arguments which mostly override config entries or enable special * features within the hub (none is ready at this development stage) */ - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.'); // Get miner instance $minerInstance = Registry::getRegistry()->getInstance('miner'); @@ -81,7 +81,7 @@ class HubConsoleMinerCommand extends BaseCommand implements Commandable { $handlerInstance = Registry::getRegistry()->getInstance('task_handler'); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Entering main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Entering main loop. ---'); /* * ----------------------------- Main loop ---------------------------- @@ -95,7 +95,7 @@ class HubConsoleMinerCommand extends BaseCommand implements Commandable { } // END - while // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main loop. ---'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Leaving main loop. ---'); } /** diff --git a/application/hub/classes/crawler/console/class_NodeConsoleCrawler.php b/application/hub/classes/crawler/console/class_NodeConsoleCrawler.php index d1b1cba58..77c6367e7 100644 --- a/application/hub/classes/crawler/console/class_NodeConsoleCrawler.php +++ b/application/hub/classes/crawler/console/class_NodeConsoleCrawler.php @@ -67,14 +67,14 @@ class NodeConsoleCrawler extends BaseNodeCrawler implements Crawler, Registerabl $app = $this->getApplicationInstance(); // Output all lines - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('Distributed Crawler v' . $app->getAppVersion()); - self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2014 Crawler Developer Team'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); - self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); - self::createDebugInstance(__CLASS__)->debugOutput('conditions; see docs/COPYING for details.'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Distributed Crawler v' . $app->getAppVersion()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Copyright (c) 2014 Crawler Developer Team'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('conditions; see docs/COPYING for details.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); } /** diff --git a/application/hub/classes/cruncher/class_BaseHubCruncher.php b/application/hub/classes/cruncher/class_BaseHubCruncher.php index bcf2e769f..db94a79bc 100644 --- a/application/hub/classes/cruncher/class_BaseHubCruncher.php +++ b/application/hub/classes/cruncher/class_BaseHubCruncher.php @@ -176,7 +176,7 @@ abstract class BaseHubCruncher extends BaseHubSystem implements Updateable { )); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('CRUNCHER: All buffers are now initialized.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRUNCHER: All buffers are now initialized.'); } /** diff --git a/application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php b/application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php index bf684cc6e..bc9d36b8f 100644 --- a/application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php +++ b/application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php @@ -119,14 +119,14 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis */ public function outputConsoleTeaser () { // Output all lines - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...'); - self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2011 - 2014 Cruncher Developer Team'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); - self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); - self::createDebugInstance(__CLASS__)->debugOutput('conditions; see docs/COPYING for details.'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Copyright (c) 2011 - 2014 Cruncher Developer Team'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('conditions; see docs/COPYING for details.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); } /** diff --git a/application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php b/application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php index 12b8038bd..71862c67a 100644 --- a/application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php +++ b/application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php @@ -104,7 +104,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ private function prepareSearchInstance (array $nodeData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Assert on array elements assert(isset($nodeData[self::DB_COLUMN_NODE_ID])); @@ -117,7 +117,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $searchInstance->setLimit(1); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); // Return it return $searchInstance; @@ -141,7 +141,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ private function prepareLocalDataSetInstance () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Get node/request instances $nodeInstance = NodeObjectFactory::createNodeInstance(); @@ -180,7 +180,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPT_BOOTSTRAP, $this->translateBooleanToYesNo($nodeInstance->isAcceptingDhtBootstrap())); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); // Return it return $dataSetInstance; @@ -194,7 +194,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function isLocalNodeRegistered () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Get a search criteria instance $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); @@ -223,7 +223,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $isRegistered = $resultInstance->valid(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: isRegistered=' . intval($isRegistered) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: isRegistered=' . intval($isRegistered) . ' - EXIT!'); // Return result return $isRegistered; @@ -236,7 +236,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function registerLocalNode () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Assert to make sure this method is called with no record in DB (the actual backend of the DHT) assert(!$this->isLocalNodeRegistered()); @@ -248,7 +248,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $this->queryInsertDataSet($dataSetInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -259,7 +259,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function updateLocalNode () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Assert to make sure this method is called with one record in DB (the actual backend of the DHT) assert($this->isLocalNodeRegistered()); @@ -284,7 +284,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $this->queryUpdateDataSet($dataSetInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -295,7 +295,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function findNodeLocalBySessionId ($sessionId) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: sessionId=' . $sessionId . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: sessionId=' . $sessionId . ' - CALLED!'); // Get search criteria $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); @@ -308,7 +308,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $resultInstance = $this->doSelectByCriteria($searchInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: resultInstance->valid()=' . intval($resultInstance->valid()) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: resultInstance->valid()=' . intval($resultInstance->valid()) . ' - EXIT!'); // Return result instance return $resultInstance; @@ -323,7 +323,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function registerNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: handlerInstance=' . $handlerInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: handlerInstance=' . $handlerInstance->__toString() . ' - CALLED!'); // Get a data set instance $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_NODE_DHT)); @@ -341,7 +341,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $this->queryInsertDataSet($dataSetInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . '] - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . '] - EXIT!'); } /** @@ -354,7 +354,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function updateNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance, LocalSearchCriteria $searchInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Get a data set instance $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_NODE_DHT)); @@ -375,7 +375,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $this->queryUpdateDataSet($dataSetInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -386,13 +386,13 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function isNodeRegistered (array $nodeData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Assert on array elements assert(isset($nodeData[self::DB_COLUMN_NODE_ID])); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: node-id=' . $nodeData[self::DB_COLUMN_NODE_ID]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: node-id=' . $nodeData[self::DB_COLUMN_NODE_ID]); // Get search criteria $searchInstance = $this->prepareSearchInstance($nodeData); @@ -412,7 +412,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $isRegistered = $resultInstance->valid(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: isRegistered=' . intval($isRegistered) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: isRegistered=' . intval($isRegistered) . ' - EXIT!'); // Return registration status return $isRegistered; @@ -428,7 +428,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function registerNode (array $nodeData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Assert on array elements assert(isset($nodeData[self::DB_COLUMN_NODE_ID])); @@ -443,7 +443,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $this->partialStub('nodeData=' . print_r($nodeData, TRUE)); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -457,13 +457,13 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function updateNode (array $nodeData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Assert on array elements assert(isset($nodeData[self::DB_COLUMN_NODE_ID])); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Updating DHT entry for node-id=' . $nodeData[self::DB_COLUMN_NODE_ID] . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Updating DHT entry for node-id=' . $nodeData[self::DB_COLUMN_NODE_ID] . ' ...'); // Is the node registered? if (!$this->isNodeRegistered($nodeData)) { @@ -487,7 +487,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $nodeInstance = NodeObjectFactory::createNodeInstance(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: nodeData=' . print_r($nodeData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: nodeData=' . print_r($nodeData, TRUE)); // Add all array elements $nodeInstance->addArrayToDataSet($dataSetInstance, $nodeData); @@ -499,7 +499,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $this->queryUpdateDataSet($dataSetInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -525,7 +525,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $hasUnpublished = $this->unpublishedEntriesInstance->valid(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); // Return it return $hasUnpublished; @@ -541,7 +541,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function initEntryPublication () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); /* * Make sure that hasUnpublishedEntries() has been called first by @@ -573,7 +573,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $this->queryUpdateDataSet($dataSetInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -584,9 +584,9 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function removeNonPublicDataFromArray(array $data) { // Currently call only inner method - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Calling parent::removeNonPublicDataFromArray(data) ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Calling parent::removeNonPublicDataFromArray(data) ...'); $data = parent::removeNonPublicDataFromArray($data); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: data[]=' . gettype($data)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: data[]=' . gettype($data)); // Return cleaned data return $data; @@ -600,7 +600,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function getResultFromExcludedSender (array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Assert on required array field assert(isset($packageData[NetworkPackage::PACKAGE_DATA_SENDER])); @@ -621,7 +621,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $resultInstance = $this->doSelectByCriteria($searchInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); // Return result instance return $resultInstance; @@ -637,7 +637,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function getResultFromKeyValue ($key, $value) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Get max recipients $maxRecipients = $this->getConfigInstance()->getConfigEntry('max_dht_recipients'); @@ -652,7 +652,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem $resultInstance = $this->doSelectByCriteria($searchInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); // Return result instance return $resultInstance; @@ -665,7 +665,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseDatabaseWrapper implem */ public function enableAcceptDhtBootstrap () { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Enabling DHT bootstrap requests ...'); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Enabling DHT bootstrap requests ...'); // Is the node already registered? if ($this->isLocalNodeRegistered()) { diff --git a/application/hub/classes/database/frontend/node/class_NodeInformationDatabaseWrapper.php b/application/hub/classes/database/frontend/node/class_NodeInformationDatabaseWrapper.php index a4c002022..105c9d6fb 100644 --- a/application/hub/classes/database/frontend/node/class_NodeInformationDatabaseWrapper.php +++ b/application/hub/classes/database/frontend/node/class_NodeInformationDatabaseWrapper.php @@ -174,7 +174,7 @@ class NodeInformationDatabaseWrapper extends BaseDatabaseWrapper implements Node */ public function removeNonPublicDataFromArray(array $data) { // Currently call only inner method - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Calling parent::removeNonPublicDataFromArray(data) ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-WRAPPER[' . __METHOD__ . ':' . __LINE__ . ']: Calling parent::removeNonPublicDataFromArray(data) ...'); $data = parent::removeNonPublicDataFromArray($data); // Return cleaned data diff --git a/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php b/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php index fb40f36ea..0915e128b 100644 --- a/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php +++ b/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php @@ -76,7 +76,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look */ private function getSenderSearchInstanceFromPackageData (array $packageData) { // Get the instance - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: Searching for sender ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: Searching for sender ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER]); $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); // Add 'sender' as the peer's IP address @@ -96,7 +96,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look */ public function isSenderNewPeer (array $packageData, StoreableCriteria $dataSetInstance = NULL) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: ' . __FUNCTION__ . ' called with packageData()=' . count($packageData) . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: ' . __FUNCTION__ . ' called with packageData()=' . count($packageData) . ' - CALLED!'); // Is the package valid? if (!isset($packageData[NetworkPackage::PACKAGE_DATA_SENDER])) { @@ -117,11 +117,11 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look $entries = $this->doSelectCountByCriteria($searchInstance, array(self::DB_COLUMN_PEER_SESSION_ID => TRUE)); // Is it there? - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: entries=' . $entries); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: entries=' . $entries); $isNewPeer = ($entries != 1); // Return the result - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: isNewPeer=' . intval($isNewPeer) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: isNewPeer=' . intval($isNewPeer) . ' - EXIT!'); return $isNewPeer; } @@ -167,7 +167,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look $this->queryInsertDataSet($dataSetInstance, array(self::DB_COLUMN_PEER_SESSION_ID => TRUE)); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: Peer ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER] . ' has been registered.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: Peer ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER] . ' has been registered.'); } /** @@ -210,7 +210,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: Peer ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER] . ' has been registered/updated with state ' . $stateInstance->getStateName()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: Peer ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER] . ' has been registered/updated with state ' . $stateInstance->getStateName()); } /** @@ -232,7 +232,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: peerName=' . $peerName . ',peerPort=' . $peerPort . ' - UNFINISHED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: peerName=' . $peerName . ',peerPort=' . $peerPort . ' - UNFINISHED!'); } /** @@ -245,7 +245,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look */ public function isSamePeerState (ConnectionHelper $helperInstance, array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: State ' . $helperInstance->getPrintableState() . ' needs to be checked it has changed ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: State ' . $helperInstance->getPrintableState() . ' needs to be checked it has changed ...'); // Now get the search instance from given package data $searchInstance = $this->getSenderSearchInstanceFromPackageData($packageData); @@ -260,7 +260,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look $rowData = $resultInstance->current(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: rowData[' . gettype($rowData) . ']=' . print_r($rowData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: rowData[' . gettype($rowData) . ']=' . print_r($rowData, TRUE)); // Assert on important elements assert(isset($rowData[self::DB_COLUMN_PEER_STATE])); @@ -269,7 +269,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look $isSamePeerState = ($rowData[self::DB_COLUMN_PEER_STATE] == $helperInstance->getPrintableState()); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: state in database: ' . $rowData[self::DB_COLUMN_PEER_STATE] . ', new state: ' . $helperInstance->getPrintableState() . ',isSamePeerState=' . intval($isSamePeerState)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: state in database: ' . $rowData[self::DB_COLUMN_PEER_STATE] . ', new state: ' . $helperInstance->getPrintableState() . ',isSamePeerState=' . intval($isSamePeerState)); // Return it return $isSamePeerState; diff --git a/application/hub/classes/decoder/package/class_PackageDecoder.php b/application/hub/classes/decoder/package/class_PackageDecoder.php index 809c11442..cf2ef7027 100644 --- a/application/hub/classes/decoder/package/class_PackageDecoder.php +++ b/application/hub/classes/decoder/package/class_PackageDecoder.php @@ -73,7 +73,7 @@ class PackageDecoder extends BaseDecoder implements Decodeable, Registerable { $unhandledDataLeft = (!$this->getHandlerInstance()->getStackInstance()->isStackEmpty(ChunkHandler::STACKER_NAME_ASSEMBLED_RAW_DATA)); // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: unhandledDataLeft=' . intval($unhandledDataLeft)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: unhandledDataLeft=' . intval($unhandledDataLeft)); return $unhandledDataLeft; } @@ -90,7 +90,7 @@ class PackageDecoder extends BaseDecoder implements Decodeable, Registerable { $rawPackageContent = $this->getHandlerInstance()->getStackInstance()->popNamed(ChunkHandler::STACKER_NAME_ASSEMBLED_RAW_DATA); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: Got ' . strlen($rawPackageContent) . ' bytes from stack ' . ChunkHandler::STACKER_NAME_ASSEMBLED_RAW_DATA . ', decoding it ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: Got ' . strlen($rawPackageContent) . ' bytes from stack ' . ChunkHandler::STACKER_NAME_ASSEMBLED_RAW_DATA . ', decoding it ...'); // "Decode" the raw package content by using the NetworkPackage instance $decodedData = $this->getPackageInstance()->decodeRawContent($rawPackageContent); @@ -105,7 +105,7 @@ class PackageDecoder extends BaseDecoder implements Decodeable, Registerable { ); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: decodedData(' . count($decodedData) . ')=' . print_r($decodedData, TRUE)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: decodedData(' . count($decodedData) . ')=' . print_r($decodedData, TRUE)); // Next get a recipient-discovery instance $discoveryInstance = PackageDiscoveryFactory::createPackageDiscoveryInstance(); @@ -116,7 +116,7 @@ class PackageDecoder extends BaseDecoder implements Decodeable, Registerable { // Check for 'recipient' field (the 'sender' field and others are ignored here) if ($discoveryInstance->isRecipientListEmpty()) { // The recipient is this node so next stack it on 'decoded_package' - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($decodedData) . ' bytes to stack ' . self::STACKER_NAME_DECODED_PACKAGE . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($decodedData) . ' bytes to stack ' . self::STACKER_NAME_DECODED_PACKAGE . ' ...'); $this->getHandlerInstance()->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_PACKAGE, $decodedData); } else { // Forward the package to the next node @@ -150,7 +150,7 @@ class PackageDecoder extends BaseDecoder implements Decodeable, Registerable { $decodedData = $this->getHandlerInstance()->getStackInstance()->popNamed(self::STACKER_NAME_DECODED_PACKAGE); // Handle it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: decodedData(' . count($decodedData) . ')=' . print_r($decodedData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: decodedData(' . count($decodedData) . ')=' . print_r($decodedData, TRUE)); $this->getPackageInstance()->handleRawData($decodedData); } } diff --git a/application/hub/classes/dht/class_BaseDht.php b/application/hub/classes/dht/class_BaseDht.php index c30d8daee..aa2efb7e0 100644 --- a/application/hub/classes/dht/class_BaseDht.php +++ b/application/hub/classes/dht/class_BaseDht.php @@ -167,7 +167,7 @@ abstract class BaseDht extends BaseHubSystem implements Distributable { assert(is_array($current)); // ... and push it to the next stack - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-DHT[' . __METHOD__ . ':' . __LINE__ . '] Pushing entry with ' . count($current) . ' elements to stack ' . self::STACKER_NAME_PENDING_PUBLISHING . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT[' . __METHOD__ . ':' . __LINE__ . '] Pushing entry with ' . count($current) . ' elements to stack ' . self::STACKER_NAME_PENDING_PUBLISHING . ' ...'); $this->getStackInstance()->pushNamed(self::STACKER_NAME_PENDING_PUBLISHING, $current); } // END - while } @@ -182,7 +182,7 @@ abstract class BaseDht extends BaseHubSystem implements Distributable { $isPending = ($this->getStackInstance()->isStackEmpty(self::STACKER_NAME_PENDING_PUBLISHING) === FALSE); // Return status - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-DHT[' . __METHOD__ . ':' . __LINE__ . '] isPending=' . intval($isPending)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT[' . __METHOD__ . ':' . __LINE__ . '] isPending=' . intval($isPending)); return $isPending; } @@ -196,7 +196,7 @@ abstract class BaseDht extends BaseHubSystem implements Distributable { $isBooting = $this->getStateInstance()->ifDhtIsBooting(); // Return status - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-DHT[' . __METHOD__ . ':' . __LINE__ . '] isBooting=' . intval($isBooting)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT[' . __METHOD__ . ':' . __LINE__ . '] isBooting=' . intval($isBooting)); return $isBooting; } @@ -227,9 +227,9 @@ abstract class BaseDht extends BaseHubSystem implements Distributable { assert(is_array($entry)); // Remove any non-public data the database layer desires - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT[' . __METHOD__ . ':' . __LINE__ . ']: Calling this->getWrapperInstance()->removeNonPublicDataFromArray(data) ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT[' . __METHOD__ . ':' . __LINE__ . ']: Calling this->getWrapperInstance()->removeNonPublicDataFromArray(data) ...'); $entry = $this->getWrapperInstance()->removeNonPublicDataFromArray($entry); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT[' . __METHOD__ . ':' . __LINE__ . ']: entry[]=' . gettype($entry)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT[' . __METHOD__ . ':' . __LINE__ . ']: entry[]=' . gettype($entry)); // Some sanity-checks again assert(is_array($entry)); diff --git a/application/hub/classes/dht/node/class_NodeDhtFacade.php b/application/hub/classes/dht/node/class_NodeDhtFacade.php index 0f3eacf15..72b2b161c 100644 --- a/application/hub/classes/dht/node/class_NodeDhtFacade.php +++ b/application/hub/classes/dht/node/class_NodeDhtFacade.php @@ -178,18 +178,18 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable { $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, TRUE) . ',handlerInstance=' . $handlerInstance->__toString() . ',forceUpdate=' . intval($forceUpdate) . ',count(getSearchData())=' . count($handlerInstance->getSearchData())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, TRUE) . ',handlerInstance=' . $handlerInstance->__toString() . ',forceUpdate=' . intval($forceUpdate) . ',count(getSearchData())=' . count($handlerInstance->getSearchData())); // Search for the node's session id and external address/hostname + TCP/UDP listen port foreach ($handlerInstance->getSearchData() as $key) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',key=' . $key); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',key=' . $key); // Is it there? assert(isset($messageData[$key])); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData[' . $key . ']=' . $messageData[$key]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData[' . $key . ']=' . $messageData[$key]); // Add criteria $searchInstance->addCriteria(str_replace('my-', '', $key), $messageData[$key]); @@ -239,7 +239,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable { assert((isset($messageData[$excludeKey])) && (isset($messageData[$andKey]))); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, TRUE)); // Get a search criteria class $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); @@ -247,7 +247,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable { // Add all keys foreach (explode($separator, $messageData[$andKey]) as $criteria) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: andKey=' . $andKey . ',criteria=' . $criteria); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: andKey=' . $andKey . ',criteria=' . $criteria); // Add it and leave any 'my-' prefix out $searchInstance->addChoiceCriteria(str_replace('my-', '', $andKey), $criteria); @@ -277,7 +277,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable { assert(count($current) > 0); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: current(' . count($current) . ')[' . gettype($current) . ']=' . print_r($current, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: current(' . count($current) . ')[' . gettype($current) . ']=' . print_r($current, TRUE)); /* * Remove some keys as they should not be published. @@ -307,7 +307,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable { // If no node is in the list (array), skip the rest of this method if (count($nodeList) == 0) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: No node record has been returned.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: No node record has been returned.'); // Abort here return; @@ -346,7 +346,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable { while ($resultInstance->next()) { // Get current entry $current = $resultInstance->current(); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: current=' . print_r($current, TRUE)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-FACADE[' . __METHOD__ . ':' . __LINE__ . ']: current=' . print_r($current, TRUE)); // Add instance to recipient list array_push($recipients, $current); diff --git a/application/hub/classes/discovery/node/class_UniversalNodeLocatorDiscovery.php b/application/hub/classes/discovery/node/class_UniversalNodeLocatorDiscovery.php index 0501bdabc..5fa1ca71d 100644 --- a/application/hub/classes/discovery/node/class_UniversalNodeLocatorDiscovery.php +++ b/application/hub/classes/discovery/node/class_UniversalNodeLocatorDiscovery.php @@ -78,7 +78,7 @@ class UniversalNodeLocatorDiscovery extends BaseNodeDiscovery implements Discove */ public function discoverUniversalNodeLocatorByConfiguredAddress ($configKey) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('UNL-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']:configKey=' . $configKey . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UNL-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']:configKey=' . $configKey . ' - CALLED!'); // Is there cache? if (!isset($GLOBALS[__METHOD__][$configKey])) { @@ -96,7 +96,7 @@ class UniversalNodeLocatorDiscovery extends BaseNodeDiscovery implements Discove } // END - if // Return cached value - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('UNL-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']:configKey=' . $configKey . ',unl=' . $GLOBALS[__METHOD__][$configKey] . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UNL-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']:configKey=' . $configKey . ',unl=' . $GLOBALS[__METHOD__][$configKey] . ' - EXIT!'); return $GLOBALS[__METHOD__][$configKey]; } } diff --git a/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php b/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php index 1ccacca4c..c1ad01c8e 100644 --- a/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php +++ b/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php @@ -112,10 +112,10 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov */ // Debug output (may flood) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' matches own ip (external=' . HubTools::determineOwnExternalAddress() . ' or internal=' . HubTools::determineOwnInternalAddress() . ')'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' matches own ip (external=' . HubTools::determineOwnExternalAddress() . ' or internal=' . HubTools::determineOwnInternalAddress() . ')'); } else { // Debug output (may flood) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' is different than own external address (' . HubTools::determineOwnExternalAddress() . ') nor internal address (' . HubTools::determineOwnInternalAddress() . '), need to forward (not yet implemented)!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RECIPIENT-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Recipient ' . $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' is different than own external address (' . HubTools::determineOwnExternalAddress() . ') nor internal address (' . HubTools::determineOwnInternalAddress() . '), need to forward (not yet implemented)!'); // This package is to be delivered to someone else, so add it // @TODO Unfinished: $this->getListInstance()->addEntry('unl', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]); diff --git a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php index 4bf16c7a4..36349d759 100644 --- a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php +++ b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php @@ -48,7 +48,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera $discoveryInstance = new PackageSocketDiscovery(); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Initialized.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Initialized.'); // Return the prepared instance return $discoveryInstance; @@ -63,7 +63,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera */ public function discoverListenerInstance (HandleableProtocol $protocolInstance, array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolInstance=' . $protocolInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolInstance=' . $protocolInstance->__toString() . ' - CALLED!'); /* * Get the listener pool instance, we need to lookup the matching @@ -78,7 +78,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera $protocolName = $protocolInstance->getProtocolName(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $protocolName . ',poolEntriesInstance=' . $poolInstance->getPoolEntriesInstance()->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $protocolName . ',poolEntriesInstance=' . $poolInstance->getPoolEntriesInstance()->__toString()); /* * Now we need to choose again. It is whether we are speaking with a hub @@ -87,7 +87,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera */ foreach ($poolInstance->getPoolEntriesInstance()->getArrayFromList($protocolName) as $listenerInstance) { // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $protocolName . ',listenerInstance[' . gettype($listenerInstance) . ']=' . $listenerInstance); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $protocolName . ',listenerInstance[' . gettype($listenerInstance) . ']=' . $listenerInstance); // Make sure the instance is valid assert($listenerInstance instanceof Listenable); @@ -95,16 +95,16 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera // Does the listener want that package? if ($listenerInstance->ifListenerAcceptsPackageData($packageData)) { // This listener likes our package data, so abort here - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Listener is accepting package data.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Listener is accepting package data.'); break; } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Listener is NOT accepting package data.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Listener is NOT accepting package data.'); } // END - foreach // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: listenerInstance=' . $listenerInstance->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: listenerInstance=' . $listenerInstance->__toString()); // Return it return $listenerInstance; @@ -123,7 +123,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera */ public function discoverSocket (array $packageData, $connectionType) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: connectionType=' . $connectionType . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: connectionType=' . $connectionType . ' - CALLED!'); // Assert on type and recipient assert($connectionType != BaseConnectionHelper::CONNECTION_TYPE_SERVER); @@ -151,7 +151,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('protocolInstance=' . $protocolInstance . ',packageData=' . print_r($packageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('protocolInstance=' . $protocolInstance . ',packageData=' . print_r($packageData, TRUE)); /* * Now we have the listener instance, we can determine the right @@ -164,9 +164,9 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera // Debug message // @TODO FIXME: I don't like these abuse of variables, better strict types if (is_resource($socketResource)) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',error=' . socket_strerror(socket_last_error($socketResource)) . ',packageData=' . print_r($packageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',error=' . socket_strerror(socket_last_error($socketResource)) . ',packageData=' . print_r($packageData, TRUE)); } else { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',packageData=' . print_r($packageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',packageData=' . print_r($packageData, TRUE)); } // Is it FALSE, the recipient isn't known to us and we have no connection to it @@ -174,13 +174,13 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera // Try to create a new socket resource try { // Possibly noisy debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Trying to establish a ' . strtoupper($protocolInstance) . ' connection to ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Trying to establish a ' . strtoupper($protocolInstance) . ' connection to ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' ...'); // Get a socket resource from our factory (if succeeded) $socketResource = SocketFactory::createSocketFromPackageData($packageData, $protocolInstance); } catch (SocketConnectionException $e) { // The connection fails of being established, so log it away - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage()); } } // END - if @@ -190,20 +190,20 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera $helperInstance = Registry::getRegistry()->getInstance('connection'); // Possibly noisy debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Going to resolve socket from peer state and given package data ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Going to resolve socket from peer state and given package data ...'); // Resolve the peer's state (but ignore return value) PeerStateResolver::resolveStateByPackage($helperInstance, $packageData, $socketResource); } catch (InvalidSocketException $e) { // This cannot be fixed, so log it away - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Cannot discover socket resource for recipient ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ': ' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: Cannot discover socket resource for recipient ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ': ' . $e->getMessage()); // Make any failed attempts to 'FALSE' $socketResource = FALSE; } // And return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: socketResource=' . $socketResource . ',packageData=' . print_r($packageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-DISCOVERY[' . __METHOD__ . ':' . __LINE__ . ']: socketResource=' . $socketResource . ',packageData=' . print_r($packageData, TRUE)); return $socketResource; } } diff --git a/application/hub/classes/factories/socket/class_SocketFactory.php b/application/hub/classes/factories/socket/class_SocketFactory.php index 9a67a3b79..ec1c9c22a 100644 --- a/application/hub/classes/factories/socket/class_SocketFactory.php +++ b/application/hub/classes/factories/socket/class_SocketFactory.php @@ -54,7 +54,7 @@ class SocketFactory extends ObjectFactory { $registryKey = 'socket_' . $protocolInstance->getProtocolName() . '_' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]; // Debug message - //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Trying to find a socket with registryKey=' . $registryKey); + //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Trying to find a socket with registryKey=' . $registryKey); // Is the key there? if (Registry::getRegistry()->instanceExists($registryKey)) { @@ -65,19 +65,19 @@ class SocketFactory extends ObjectFactory { $socketResource = $containerInstance->getSocketResource(); // Debug message - //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Using socket ' . $socketResource . '(' . gettype($socketResource) . ') from registry.'); + //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Using socket ' . $socketResource . '(' . gettype($socketResource) . ') from registry.'); } else { // Construct configuration entry for object factory and get it $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry($protocolInstance->getProtocolName() . '_connection_helper_class'); // Debug message - //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Going to use class ' . $className . ' for creating a socket resource ...'); + //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Going to use class ' . $className . ' for creating a socket resource ...'); // And call the static method $socketResource = call_user_func($className . '::createConnectionFromPackageData', $packageData); // Debug message - //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Created socket ' . $socketResource . '(' . gettype($socketResource) . ') from class ' . $className . '.'); + //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Created socket ' . $socketResource . '(' . gettype($socketResource) . ') from class ' . $className . '.'); // Construct container class, this won't be reached if an exception is thrown $containerInstance = self::CreateObjectByConfiguredName('socket_container_class', array($socketResource, NULL, $packageData)); @@ -86,7 +86,7 @@ class SocketFactory extends ObjectFactory { Registry::getRegistry()->addInstance($registryKey, $containerInstance); // Debug message - //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Socket is now registered in registry.'); + //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Socket is now registered in registry.'); } // Return the resource diff --git a/application/hub/classes/factories/states/communicator/class_CommunicatorStateFactory.php b/application/hub/classes/factories/states/communicator/class_CommunicatorStateFactory.php index d0fbf8342..6cdfc6a76 100644 --- a/application/hub/classes/factories/states/communicator/class_CommunicatorStateFactory.php +++ b/application/hub/classes/factories/states/communicator/class_CommunicatorStateFactory.php @@ -48,7 +48,7 @@ class CommunicatorStateFactory extends ObjectFactory { $stateInstance = self::createObjectByConfiguredName($className, array($communicatorInstance)); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('COMMUNICATOR-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Communicator state has changed from ' . $communicatorInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COMMUNICATOR-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Communicator state has changed from ' . $communicatorInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Once we have that state, set it in the communicator instance $communicatorInstance->setStateInstance($stateInstance); diff --git a/application/hub/classes/factories/states/crawler/class_CrawlerStateFactory.php b/application/hub/classes/factories/states/crawler/class_CrawlerStateFactory.php index 4b0eb52fb..e1ee18e3b 100644 --- a/application/hub/classes/factories/states/crawler/class_CrawlerStateFactory.php +++ b/application/hub/classes/factories/states/crawler/class_CrawlerStateFactory.php @@ -50,7 +50,7 @@ class CrawlerStateFactory extends ObjectFactory { $crawlerInstance = Registry::getRegistry()->getInstance('crawler'); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Crawler state has changed from ' . $crawlerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Crawler state has changed from ' . $crawlerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Once we have that state, set it in the crawler instance $crawlerInstance->setStateInstance($stateInstance); diff --git a/application/hub/classes/factories/states/cruncher/class_CruncherStateFactory.php b/application/hub/classes/factories/states/cruncher/class_CruncherStateFactory.php index 8701aa589..eac13d2e2 100644 --- a/application/hub/classes/factories/states/cruncher/class_CruncherStateFactory.php +++ b/application/hub/classes/factories/states/cruncher/class_CruncherStateFactory.php @@ -51,7 +51,7 @@ class CruncherStateFactory extends ObjectFactory { $stateInstance = self::createObjectByConfiguredName($className); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('CRUNCHER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Cruncher state has changed from ' . $cruncherInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRUNCHER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Cruncher state has changed from ' . $cruncherInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Once we have that state, set it in the cruncher instance $cruncherInstance->setStateInstance($stateInstance); diff --git a/application/hub/classes/factories/states/dht/class_DhtStateFactory.php b/application/hub/classes/factories/states/dht/class_DhtStateFactory.php index dfa1eade3..0d786bd80 100644 --- a/application/hub/classes/factories/states/dht/class_DhtStateFactory.php +++ b/application/hub/classes/factories/states/dht/class_DhtStateFactory.php @@ -48,7 +48,7 @@ class DhtStateFactory extends ObjectFactory { $stateInstance = self::createObjectByConfiguredName($className, array($dhtInstance)); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('DHT-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: DHT state has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: DHT state has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Once we have that state, set it in the DHT instance $dhtInstance->setStateInstance($stateInstance); diff --git a/application/hub/classes/factories/states/miner/class_MinerStateFactory.php b/application/hub/classes/factories/states/miner/class_MinerStateFactory.php index 2b2a7e02f..068a0a756 100644 --- a/application/hub/classes/factories/states/miner/class_MinerStateFactory.php +++ b/application/hub/classes/factories/states/miner/class_MinerStateFactory.php @@ -50,7 +50,7 @@ class MinerStateFactory extends ObjectFactory { $stateInstance = self::createObjectByConfiguredName($className); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Miner state has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MINER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Miner state has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Once we have that state, set it in the miner instance $minerInstance->setStateInstance($stateInstance); diff --git a/application/hub/classes/factories/states/node/class_NodeStateFactory.php b/application/hub/classes/factories/states/node/class_NodeStateFactory.php index 46212da4f..8b6727788 100644 --- a/application/hub/classes/factories/states/node/class_NodeStateFactory.php +++ b/application/hub/classes/factories/states/node/class_NodeStateFactory.php @@ -54,7 +54,7 @@ class NodeStateFactory extends ObjectFactory { $stateInstance = self::createObjectByConfiguredName($className, array($nodeInstance)); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('NODE-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Node state has changed from ' . $nodeInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Node state has changed from ' . $nodeInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Once we have that state, set it in the node instance $nodeInstance->setStateInstance($stateInstance); diff --git a/application/hub/classes/factories/states/peer/class_PeerStateFactory.php b/application/hub/classes/factories/states/peer/class_PeerStateFactory.php index dea14b8ed..2c9239877 100644 --- a/application/hub/classes/factories/states/peer/class_PeerStateFactory.php +++ b/application/hub/classes/factories/states/peer/class_PeerStateFactory.php @@ -81,13 +81,13 @@ class PeerStateFactory extends ObjectFactory { $tableInstance->purgeOldEntriesBySocketResource($socketResource); } catch (InvalidSocketException $e) { // Just log all errors - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Purging of old entries failed. Message from exception: ' . $e->getMessage()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Purging of old entries failed. Message from exception: ' . $e->getMessage()); } // Do we have an entry? if ($tableInstance->isSenderNewPeer($packageData)) { // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] errorCode=' . $errorCode); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] errorCode=' . $errorCode); // Register the new peer with its session id $tableInstance->registerPeerByPackageData($packageData, $socketResource); @@ -102,7 +102,7 @@ class PeerStateFactory extends ObjectFactory { $tableInstance->registerPeerState($stateInstance, $packageData); } elseif ($tableInstance->isSamePeerState($helperInstance, $packageData)) { // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Peer state unchanged, re-generating old state ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Peer state unchanged, re-generating old state ...'); /* * The peer's state has noot changed, still we have to return a @@ -111,7 +111,7 @@ class PeerStateFactory extends ObjectFactory { $stateInstance = self::createPeerStateInstanceByName($helperInstance->getPrintableState(), $helperInstance); } else { // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Updating peer state ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Updating peer state ...'); /* * It is an already known peer but with a changed state. So first @@ -124,7 +124,7 @@ class PeerStateFactory extends ObjectFactory { } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Peer state has changed from ' . $helperInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . ' (' . $stateInstance->__toString() . ').'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Peer state has changed from ' . $helperInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . ' (' . $stateInstance->__toString() . ').'); // Set the state in the helper $helperInstance->setStateInstance($stateInstance); @@ -146,7 +146,7 @@ class PeerStateFactory extends ObjectFactory { $stateInstance = self::createObjectByConfiguredName('peer_' . $stateName . '_state_class', array($helperInstance)); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Peer state has changed from ' . $helperInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . ' (' . $stateInstance->__toString() . ').'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PEER-STATE-FACTORY[' . __LINE__ . ':] Peer state has changed from ' . $helperInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . ' (' . $stateInstance->__toString() . ').'); // Once we have that state, set it in the peer instance $helperInstance->setStateInstance($stateInstance); diff --git a/application/hub/classes/feature/hubcoin_reward/class_HubcoinRewardFeature.php b/application/hub/classes/feature/hubcoin_reward/class_HubcoinRewardFeature.php index 5c987420d..ea6bf3229 100644 --- a/application/hub/classes/feature/hubcoin_reward/class_HubcoinRewardFeature.php +++ b/application/hub/classes/feature/hubcoin_reward/class_HubcoinRewardFeature.php @@ -52,13 +52,13 @@ class HubcoinRewardFeature extends BaseFeature implements Feature { */ public function isFeatureAvailable () { // Debug message - //* 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__)); // Testing this feature is pretty simple: $isAvailable = (($this->getConfigInstance()->getConfigEntry('extension_scrypt_loaded') === TRUE) && (extension_loaded('scrypt')) && (is_callable('scrypt'))); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: isAvailable=%d - EXIT!', __METHOD__, __LINE__, intval($isAvailable))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: isAvailable=%d - EXIT!', __METHOD__, __LINE__, intval($isAvailable))); // Return status return $isAvailable; @@ -76,7 +76,7 @@ class HubcoinRewardFeature extends BaseFeature implements Feature { */ public function featureMethodGenerateHash ($data) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: data()=%d - CALLED!', __METHOD__, __LINE__, strlen($data))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: data()=%d - CALLED!', __METHOD__, __LINE__, strlen($data))); // Make sure the feature is available assert(FrameworkFeature::isFeatureAvailable('hubcoin_reward')); @@ -85,7 +85,7 @@ class HubcoinRewardFeature extends BaseFeature implements Feature { $hash = Scrypt::hashScrypt($data); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: hash=%s - EXIT!', __METHOD__, __LINE__, $hash)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: hash=%s - EXIT!', __METHOD__, __LINE__, $hash)); // Return generated hash return $hash; @@ -100,7 +100,7 @@ class HubcoinRewardFeature extends BaseFeature implements Feature { */ public function featureMethodCheckHash ($data, $hash) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: data()=%d,hash=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $hash)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: data()=%d,hash=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $hash)); // Make sure the feature is available assert(FrameworkFeature::isFeatureAvailable('hubcoin_reward')); @@ -109,7 +109,7 @@ class HubcoinRewardFeature extends BaseFeature implements Feature { $isValid = Scrypt::checkScrypt($data, $hash); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: isValid=%d - EXIT!', __METHOD__, __LINE__, intval($isValid))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: isValid=%d - EXIT!', __METHOD__, __LINE__, intval($isValid))); // Return status return $isValid; diff --git a/application/hub/classes/filter/bootstrap/apt-proxy/class_AptProxyBootstrapGenericActivationFilter.php b/application/hub/classes/filter/bootstrap/apt-proxy/class_AptProxyBootstrapGenericActivationFilter.php index 34021a606..ca66f3a78 100644 --- a/application/hub/classes/filter/bootstrap/apt-proxy/class_AptProxyBootstrapGenericActivationFilter.php +++ b/application/hub/classes/filter/bootstrap/apt-proxy/class_AptProxyBootstrapGenericActivationFilter.php @@ -61,7 +61,7 @@ class AptProxyBootstrapGenericActivationFilter extends BaseAptProxyFilter implem $proxyInstance->enableIsActive(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: apt-proxy has been activated.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: apt-proxy has been activated.'); } } diff --git a/application/hub/classes/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php b/application/hub/classes/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php index afe2bd455..63b12afe5 100644 --- a/application/hub/classes/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php +++ b/application/hub/classes/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php @@ -61,7 +61,7 @@ class ChatBootstrapGenericActivationFilter extends BaseChatFilter implements Fil $chatInstance->enableIsActive(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: The chat console has been activated.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: The chat console has been activated.'); } } diff --git a/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php b/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php index cfe1b0d20..99d0d9223 100644 --- a/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php +++ b/application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php @@ -61,7 +61,7 @@ class CrawlerBootstrapGenericActivationFilter extends BaseCrawlerFilter implemen $crawlerInstance->enableIsActive(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: The crawler has been activated.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: The crawler has been activated.'); } } diff --git a/application/hub/classes/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php b/application/hub/classes/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php index 72a995949..346389186 100644 --- a/application/hub/classes/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php +++ b/application/hub/classes/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php @@ -61,7 +61,7 @@ class CruncherBootstrapGenericActivationFilter extends BaseCruncherFilter implem $cruncherInstance->enableIsActive(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: The cruncher has been activated.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: The cruncher has been activated.'); } } diff --git a/application/hub/classes/filter/bootstrap/miner/class_MinerBootstrapGenericActivationFilter.php b/application/hub/classes/filter/bootstrap/miner/class_MinerBootstrapGenericActivationFilter.php index 08d0c7cb0..5d5952a25 100644 --- a/application/hub/classes/filter/bootstrap/miner/class_MinerBootstrapGenericActivationFilter.php +++ b/application/hub/classes/filter/bootstrap/miner/class_MinerBootstrapGenericActivationFilter.php @@ -61,7 +61,7 @@ class MinerBootstrapGenericActivationFilter extends BaseMinerFilter implements F $minerInstance->enableIsActive(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: The miner has been activated.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: The miner has been activated.'); } } diff --git a/application/hub/classes/filter/class_BaseHubFilter.php b/application/hub/classes/filter/class_BaseHubFilter.php index 6346a60ec..c837c2091 100644 --- a/application/hub/classes/filter/class_BaseHubFilter.php +++ b/application/hub/classes/filter/class_BaseHubFilter.php @@ -72,7 +72,7 @@ class BaseHubFilter extends BaseFilter { $templateInstance->renderXmlContent($messageContent); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(str_replace('_', '-', strtoupper($messageType)) . '-TAG: Handling ' . strlen($messageContent) . ' bytes: ' . $messageContent); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(str_replace('_', '-', strtoupper($messageType)) . '-TAG: Handling ' . strlen($messageContent) . ' bytes: ' . $messageContent); /* * The template system now stores all required data as 'general' @@ -90,14 +90,14 @@ class BaseHubFilter extends BaseFilter { */ if (is_null($value)) { // Output a warning - self::createDebugInstance(__CLASS__)->debugOutput(str_replace('_', '-', strtoupper($messageType)) . '-TAG: Found not fully supported variable ' . $key . ' - skipping.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(str_replace('_', '-', strtoupper($messageType)) . '-TAG: Found not fully supported variable ' . $key . ' - skipping.'); // Skip this part, don't write NULLs to the array continue; } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(str_replace('_', '-', strtoupper($messageType)) . '-TAG: key=' . $key . ',value=' . $value); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(str_replace('_', '-', strtoupper($messageType)) . '-TAG: key=' . $key . ',value=' . $value); // Set it now $this->dataXmlNodes[$key] = $value; diff --git a/application/hub/classes/filter/miner/class_MinerPhpRequirementsFilter.php b/application/hub/classes/filter/miner/class_MinerPhpRequirementsFilter.php index 918568833..c8ec3bf79 100644 --- a/application/hub/classes/filter/miner/class_MinerPhpRequirementsFilter.php +++ b/application/hub/classes/filter/miner/class_MinerPhpRequirementsFilter.php @@ -69,11 +69,11 @@ class MinerPhpRequirementsFilter extends BaseMinerFilter implements Filterable { // If scrypt() is not found (ext-scrypt) then the "Hubcoins reward" is not working if ((extension_loaded('scrypt')) && (is_callable('scrypt'))) { // Mark it as working - self::createDebugInstance(__CLASS__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-scrypt and a callable scrypt() function found. "Hubcoin reward" feature possible.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-scrypt and a callable scrypt() function found. "Hubcoin reward" feature possible.'); $this->getConfigInstance()->setConfigEntry('extension_scrypt_loaded', TRUE); } else { // Not working (not all have ext-scrypt installed - self::createDebugInstance(__CLASS__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-scrypt not found or scrypt() function not found. "Hubcoin reward" feature disabled.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-scrypt not found or scrypt() function not found. "Hubcoin reward" feature disabled.'); } // Are all tests passed? diff --git a/application/hub/classes/filter/node/class_NodeInitializationFilter.php b/application/hub/classes/filter/node/class_NodeInitializationFilter.php index f15806bfa..f8f1ddaa6 100644 --- a/application/hub/classes/filter/node/class_NodeInitializationFilter.php +++ b/application/hub/classes/filter/node/class_NodeInitializationFilter.php @@ -64,7 +64,7 @@ class NodeInitializationFilter extends BaseNodeFilter implements Filterable { } // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE-INIT-FILTER[' . __METHOD__ . ':' . __LINE__ . ']: Node ' . $nodeMode . ' has been added to registry.'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-INIT-FILTER[' . __METHOD__ . ':' . __LINE__ . ']: Node ' . $nodeMode . ' has been added to registry.'); } } diff --git a/application/hub/classes/filter/node/class_NodePhpRequirementsFilter.php b/application/hub/classes/filter/node/class_NodePhpRequirementsFilter.php index 7bbda8b38..c3e31ca2b 100644 --- a/application/hub/classes/filter/node/class_NodePhpRequirementsFilter.php +++ b/application/hub/classes/filter/node/class_NodePhpRequirementsFilter.php @@ -69,21 +69,21 @@ class NodePhpRequirementsFilter extends BaseNodeFilter implements Filterable { // If scrypt() is not found (ext-scrypt) then the "Hubcoins reward" is not working if ((extension_loaded('scrypt')) && (is_callable('scrypt'))) { // Mark it as working - self::createDebugInstance(__CLASS__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-scrypt and a callable scrypt() function found. "Hubcoin reward" feature possible.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-scrypt and a callable scrypt() function found. "Hubcoin reward" feature possible.'); $this->getConfigInstance()->setConfigEntry('extension_scrypt_loaded', TRUE); } else { // Not working (not all have ext-scrypt installed - self::createDebugInstance(__CLASS__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-scrypt not found or scrypt() function not found. "Hubcoin reward" feature disabled.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-scrypt not found or scrypt() function not found. "Hubcoin reward" feature disabled.'); } // If uuid_create() is not found (ext-uuid) then some keys are a bit weaker if ((extension_loaded('uuid')) && (is_callable('uuid_create'))) { // Mark it as working - self::createDebugInstance(__CLASS__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-uuid and a callable uuid_create() function found. UUID "entropy" available.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-uuid and a callable uuid_create() function found. UUID "entropy" available.'); $this->getConfigInstance()->setConfigEntry('extension_uuid_loaded', TRUE); } else { // Not working (not all have ext-uuid installed - self::createDebugInstance(__CLASS__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-uuid not found or uuid_create() function not found. UUID "entropy" disabled.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER[' . __METHOD__ . ':' . __LINE__ . '] ext-uuid not found or uuid_create() function not found. UUID "entropy" disabled.'); } // Are all tests passed? diff --git a/application/hub/classes/handler/chunks/class_ChunkHandler.php b/application/hub/classes/handler/chunks/class_ChunkHandler.php index 6054bde60..5afb9c91e 100644 --- a/application/hub/classes/handler/chunks/class_ChunkHandler.php +++ b/application/hub/classes/handler/chunks/class_ChunkHandler.php @@ -131,7 +131,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable */ private function initHandler () { // Noisy debug line: - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Initializing handler ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Initializing handler ...'); // Init finalPackageChunks $this->finalPackageChunks = array( @@ -163,7 +163,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable */ private function isChunkHashValid (array $chunkSplits) { // Noisy debug line: - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: chunkSplits=' . print_r($chunkSplits, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: chunkSplits=' . print_r($chunkSplits, TRUE)); // Assert on some elements assert(isset($chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA])); @@ -176,7 +176,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable $isValid = ($chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] === $chunkHash); // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: chunkHash=' . $chunkHash . ',isValid=' . intval($isValid)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: chunkHash=' . $chunkHash . ',isValid=' . intval($isValid)); // ... and return it return $isValid; @@ -215,7 +215,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: serialNumber=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ',hash=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: serialNumber=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ',hash=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH]); // Add the chunk data (index 2) to the final array and use the serial number as index $this->finalPackageChunks['content'][$chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL]] = $chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA]; @@ -294,7 +294,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable */ private function verifyChunkSerialNumbers () { // Debug message - //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: finalPackageChunks=' . print_r($this->finalPackageChunks, TRUE)); + //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: finalPackageChunks=' . print_r($this->finalPackageChunks, TRUE)); // Get final hash $finalHash = $this->generateFinalHash(implode('', $this->finalPackageChunks['content'])); @@ -308,7 +308,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable $nextSerial = $this->fragmenterInstance->getNextHexSerialNumber($finalHash); // Debug output - //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: serialNumber=' . $serialNumber . ',nextSerial=' . $nextSerial); + //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: serialNumber=' . $serialNumber . ',nextSerial=' . $nextSerial); // Is it not the same? Then re-request it if ($serialNumber != $nextSerial) { @@ -337,14 +337,14 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable $this->rawPackageData = ''; // That went well, so start assembling all chunks - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Handling ' . count($this->finalPackageChunks['content']) . ' entries ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Handling ' . count($this->finalPackageChunks['content']) . ' entries ...'); foreach ($this->finalPackageChunks['content'] as $serialNumber => $content) { // Assert on 'hash' entry (must always be set) assert(isset($this->finalPackageChunks['hashes'][$serialNumber])); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: serialNumber=' . $serialNumber . ',hashes=' . $this->finalPackageChunks['hashes'][$serialNumber] . ' - validating ...'); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('finalPackageChunks=' . print_r($this->finalPackageChunks, TRUE) . 'chunkHashes=' . print_r($this->chunkHashes, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: serialNumber=' . $serialNumber . ',hashes=' . $this->finalPackageChunks['hashes'][$serialNumber] . ' - validating ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('finalPackageChunks=' . print_r($this->finalPackageChunks, TRUE) . 'chunkHashes=' . print_r($this->chunkHashes, TRUE)); // Is this chunk valid? This should be the case assert($this->isChunkHashValid(array( @@ -356,12 +356,12 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable assert(in_array($this->finalPackageChunks['hashes'][$serialNumber], $this->chunkHashes)); // Verification okay, add it to the raw data - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($content) . ' bytes as raw package data ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($content) . ' bytes as raw package data ...'); $this->rawPackageData .= $content; } // END - foreach // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: eopChunk[1]=' . $this->eopChunk[1] . ',index=' . (count($this->chunkHashes) - 2) . ',chunkHashes='.print_r($this->chunkHashes, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: eopChunk[1]=' . $this->eopChunk[1] . ',index=' . (count($this->chunkHashes) - 2) . ',chunkHashes='.print_r($this->chunkHashes, TRUE)); // The last chunk hash must match with the one from eopChunk[1] assert($this->eopChunk[1] == $this->chunkHashes[count($this->chunkHashes) - 2]); @@ -399,7 +399,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable $finalHash = $this->generateFinalHash($this->rawPackageData); // Is it the same? - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: eopChunk[1]=' . $this->eopChunk[1] . ',finalHash=' . $finalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: eopChunk[1]=' . $this->eopChunk[1] . ',finalHash=' . $finalHash); assert($finalHash == $this->eopChunk[0]); } @@ -417,7 +417,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable $chunkSplits = explode(PackageFragmenter::CHUNK_DATA_HASH_SEPARATOR, $chunks[count($chunks) - 1]); // Make sure chunks with only 3 elements are parsed (for details see ChunkHandler) - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('eopChunk=' . $chunks[count($chunks) - 1] . ',chunkSplits=' . print_r($chunkSplits, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('eopChunk=' . $chunks[count($chunks) - 1] . ',chunkSplits=' . print_r($chunkSplits, TRUE)); assert(count($chunkSplits) == 3); // Validate final chunk @@ -518,7 +518,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable // Is the generated hash from data same ("valid") as given hash? if (!$this->isChunkHashValid($chunkSplits)) { // Do some logging - self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Chunk content is not validating against given hash.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Chunk content is not validating against given hash.'); // Re-request this chunk (trust the hash in index # 0) $this->rerequestChunkBySplitsArray($chunkSplits); @@ -530,7 +530,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable // Is the serial number valid (chars 0-9, length equals PackageFragmenter::MAX_SERIAL_LENGTH)? if (!$this->isSerialNumberValid($chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL])) { // Do some logging - self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Chunk serial number ' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ' for hash ' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] . ' is invalid.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Chunk serial number ' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ' for hash ' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] . ' is invalid.'); // Re-request this chunk $this->rerequestChunkBySplitsArray($chunkSplits); @@ -614,7 +614,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable break; default: // Invalid step found - self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Invalid step ' . $this->finalPackageChunks['assemble_steps'] . ' detected.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Invalid step ' . $this->finalPackageChunks['assemble_steps'] . ' detected.'); break; } // END - switch } @@ -628,11 +628,11 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable */ public function ifRawPackageDataIsAvailable () { // Check it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: this->rawPackageData()=' . strlen($this->rawPackageData) . ',ifUnassembledChunksAvailable()=' . intval($this->ifUnassembledChunksAvailable())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: this->rawPackageData()=' . strlen($this->rawPackageData) . ',ifUnassembledChunksAvailable()=' . intval($this->ifUnassembledChunksAvailable())); $isRawPackageDataAvailable = ((!empty($this->rawPackageData)) && (!$this->ifUnassembledChunksAvailable())); // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: isRawPackageDataAvailable=' . intval($isRawPackageDataAvailable)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: isRawPackageDataAvailable=' . intval($isRawPackageDataAvailable)); return $isRawPackageDataAvailable; } @@ -647,7 +647,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable assert($this->ifRawPackageDataIsAvailable()); // Then feed it into the next stacker - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($this->rawPackageData) . ' bytes to stack ' . self::STACKER_NAME_ASSEMBLED_RAW_DATA . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($this->rawPackageData) . ' bytes to stack ' . self::STACKER_NAME_ASSEMBLED_RAW_DATA . ' ...'); $this->getStackInstance()->pushNamed(self::STACKER_NAME_ASSEMBLED_RAW_DATA, $this->rawPackageData); // ... and reset it diff --git a/application/hub/classes/handler/message-types/announcement/class_NodeMessageAnnouncementHandler.php b/application/hub/classes/handler/message-types/announcement/class_NodeMessageAnnouncementHandler.php index e9ed6af79..5f14fc1e0 100644 --- a/application/hub/classes/handler/message-types/announcement/class_NodeMessageAnnouncementHandler.php +++ b/application/hub/classes/handler/message-types/announcement/class_NodeMessageAnnouncementHandler.php @@ -133,7 +133,7 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl assert(isset($messageData[$key])); // Add it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Adding messageData[' . $key . ']=' . $messageData[$key] . ' ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Adding messageData[' . $key . ']=' . $messageData[$key] . ' ...'); $dataSetInstance->addCriteria($key, $messageData[$key]); } // END - foreach } @@ -146,12 +146,12 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl */ protected function initMessageConfigurationData (array $messageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); // "Walk" throught the translation array foreach ($this->messageToConfig as $messageKey => $configKey) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]); // Set the element in configuration $this->getConfigInstance()->setConfigEntry($configKey, $messageData[$messageKey]); @@ -160,7 +160,7 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl // "Walk" throught the config-copy array foreach ($this->configCopy as $targetKey => $sourceKey) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...'); // Copy from source to targetKey $this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey)); diff --git a/application/hub/classes/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php b/application/hub/classes/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php index 058b9ce55..9f7700f30 100644 --- a/application/hub/classes/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php +++ b/application/hub/classes/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php @@ -107,12 +107,12 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme parent::addArrayToDataSet($dataSetInstance, $messageData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANSWER-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ANSWER-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); // Add all ements foreach ($this->messageDataElements as $key) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANSWER-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData[' . $key . ']=' . $messageData[$key]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ANSWER-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData[' . $key . ']=' . $messageData[$key]); // Is it there? assert(isset($messageData[$key])); diff --git a/application/hub/classes/handler/message-types/dht/class_NodeMessageDhtBootstrapHandler.php b/application/hub/classes/handler/message-types/dht/class_NodeMessageDhtBootstrapHandler.php index 0bf5c5964..4a70de026 100644 --- a/application/hub/classes/handler/message-types/dht/class_NodeMessageDhtBootstrapHandler.php +++ b/application/hub/classes/handler/message-types/dht/class_NodeMessageDhtBootstrapHandler.php @@ -136,12 +136,12 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl */ protected function initMessageConfigurationData (array $messageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-BOOTSTRAP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-BOOTSTRAP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); // "Walk" throught the translation array foreach ($this->messageToConfig as $messageKey => $configKey) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-BOOTSTRAP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-BOOTSTRAP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]); // Set the element in configuration $this->getConfigInstance()->setConfigEntry($configKey, $messageData[$messageKey]); @@ -150,7 +150,7 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl // "Walk" throught the config-copy array foreach ($this->configCopy as $targetKey => $sourceKey) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-BOOTSTRAP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-BOOTSTRAP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...'); // Copy from source to target key $this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey)); diff --git a/application/hub/classes/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php b/application/hub/classes/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php index 92cc25eac..e52e0b365 100644 --- a/application/hub/classes/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php +++ b/application/hub/classes/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php @@ -119,12 +119,12 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha */ protected function initMessageConfigurationData (array $messageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REQUEST-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REQUEST-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); // "Walk" throught the config-copy array foreach ($this->configCopy as $targetKey => $sourceKey) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REQUEST-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REQUEST-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...'); // Copy from source to targetKey $this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey)); @@ -140,7 +140,7 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha ); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REQUEST-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Got a node list of ' . count($nodeList) . ' entry/-ies back.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REQUEST-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Got a node list of ' . count($nodeList) . ' entry/-ies back.'); // Set it serialized in configuration (temporarily) $this->getConfigInstance()->setConfigEntry('node_list', base64_encode(json_encode($nodeList))); diff --git a/application/hub/classes/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php b/application/hub/classes/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php index e1ac210a2..b8eea12c4 100644 --- a/application/hub/classes/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php +++ b/application/hub/classes/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php @@ -62,7 +62,7 @@ class NodeMessageSelfConnectHandler extends BaseMessageHandler implements Handle // Are node id and session id the same? if (($messageData[XmlSelfConnectTemplateEngine::SELF_CONNECT_DATA_NODE_ID] == $nodeInstance->getNodeId()) && ($messageData[XmlSelfConnectTemplateEngine::SELF_CONNECT_DATA_SESSION_ID] == $nodeInstance->getSessionId())) { // Both are equal - self::createDebugInstance(__CLASS__)->debugOutput('SELF-CONNECT[' . __METHOD__ . ':' . __LINE__ . ']: Have connected to myself, both node and session id are equal!'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SELF-CONNECT[' . __METHOD__ . ':' . __LINE__ . ']: Have connected to myself, both node and session id are equal!'); // ... and change state $nodeInstance->getStateInstance()->nodeHasSelfConnected(); diff --git a/application/hub/classes/handler/network/tcp/class_TcpRawDataHandler.php b/application/hub/classes/handler/network/tcp/class_TcpRawDataHandler.php index 1c8532a4b..b9ca07683 100644 --- a/application/hub/classes/handler/network/tcp/class_TcpRawDataHandler.php +++ b/application/hub/classes/handler/network/tcp/class_TcpRawDataHandler.php @@ -71,7 +71,7 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { $this->setErrorCode(self::SOCKET_ERROR_UNHANDLED); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Handling TCP package from resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',type=' . $socketArray[BasePool::SOCKET_ARRAY_CONN_TYPE] . ',last error=' . socket_strerror($this->lastSocketError)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Handling TCP package from resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',type=' . $socketArray[BasePool::SOCKET_ARRAY_CONN_TYPE] . ',last error=' . socket_strerror($this->lastSocketError)); /* * Read the raw data from socket. If you change PHP_BINARY_READ to @@ -84,13 +84,13 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { $this->lastSocketError = socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]); // Debug output of read data length - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: rawData[' . gettype($rawData) . ']=' . strlen($rawData) . ',MD5=' . md5($rawData) . ',resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',error=' . socket_strerror($this->lastSocketError)); - //* NOISY-DEBUG: */ if ($rawData !== FALSE) self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: rawData=' . $rawData); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: rawData[' . gettype($rawData) . ']=' . strlen($rawData) . ',MD5=' . md5($rawData) . ',resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',error=' . socket_strerror($this->lastSocketError)); + //* NOISY-DEBUG: */ if ($rawData !== FALSE) self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: rawData=' . $rawData); // Is it valid? if ($this->lastSocketError == 11) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Ignoring error 11 (Resource temporary unavailable) from socket resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Ignoring error 11 (Resource temporary unavailable) from socket resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE]); /* * Error code 11 (Resource temporary unavailable) can be safely @@ -114,7 +114,7 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { * well-formed BASE64-encoded message with start and markers. This * will be checked later on. */ - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($rawData) . ' bytes to stacker ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($rawData) . ' bytes to stacker ...'); $this->addRawDataToStacker($rawData); } } diff --git a/application/hub/classes/handler/protocol/class_BaseProtocolHandler.php b/application/hub/classes/handler/protocol/class_BaseProtocolHandler.php index fba651e75..27bc54ff6 100644 --- a/application/hub/classes/handler/protocol/class_BaseProtocolHandler.php +++ b/application/hub/classes/handler/protocol/class_BaseProtocolHandler.php @@ -75,13 +75,13 @@ class BaseProtocolHandler extends BaseHandler { */ protected final function isValidUniversalNodeLocator ($unl) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',regex=' . $regex . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',regex=' . $regex . ' - CALLED!'); // Very basic regex check $isValid = (preg_match($this->getRegularExpression(), $unl) === 1); // Return result - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: isValid=' . intval($isValid) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: isValid=' . intval($isValid) . ' - EXIT!'); return $isValid; } @@ -106,7 +106,7 @@ class BaseProtocolHandler extends BaseHandler { */ protected function parseGenericUniversalNodeLocator ($unl) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ' - CALLED!'); // Make sure the UNL is valid assert($this->isValidUniversalNodeLocator($unl)); @@ -128,7 +128,7 @@ class BaseProtocolHandler extends BaseHandler { ); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unlData=' . print_r($unlData, TRUE) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unlData=' . print_r($unlData, TRUE) . ' - EXIT!'); // Return the generic array return $unlData; @@ -189,14 +189,14 @@ class BaseProtocolHandler extends BaseHandler { $internalUnl = HubTools::determineOwnInternalAddress(); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',externalUnl=' . $externalUnl . ',internalUnl=' . $internalUnl); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',externalUnl=' . $externalUnl . ',internalUnl=' . $internalUnl); //* DIE-DEBUG: */ die(__METHOD__.':unl=' . $unl . ',this='.print_r($this, TRUE)); // Is it the same? $ifMatches = (($unl === $externalUnl) || ($unl === $internalUnl)); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: ifMatches=' . intval($ifMatches)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: ifMatches=' . intval($ifMatches)); // Return result return $ifMatches; diff --git a/application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php b/application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php index 686f00685..5702c12f3 100644 --- a/application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php +++ b/application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php @@ -83,7 +83,7 @@ class BaseIpV4ProtocolHandler extends BaseProtocolHandler { */ protected function parseUniversalNodeLocator ($unl) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ' - CALLED!'); // First generic parse $unlData = parent::parseGenericUniversalNodeLocator($unl); @@ -103,7 +103,7 @@ class BaseIpV4ProtocolHandler extends BaseProtocolHandler { unset($unlData[UniversalNodeLocator::UNL_PART_EXTRA]); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unlData=' . print_r($unlData, TRUE) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unlData=' . print_r($unlData, TRUE) . ' - EXIT!'); return $unlData; } @@ -116,7 +116,7 @@ class BaseIpV4ProtocolHandler extends BaseProtocolHandler { */ public function isValidUniversalNodeLocatorByPackageData (array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Is 'recipient' there? assert(isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])); @@ -128,7 +128,7 @@ class BaseIpV4ProtocolHandler extends BaseProtocolHandler { $isValid = $this->isValidUniversalNodeLocator($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: PACKAGE_DATA_RECIPIENT=' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ',isValid[' . gettype($isValid) . ']=' . intval($isValid)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: PACKAGE_DATA_RECIPIENT=' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ',isValid[' . gettype($isValid) . ']=' . intval($isValid)); // If this doesn't fail, continue validating the IP:port combination if ($isValid === TRUE) { @@ -150,7 +150,7 @@ class BaseIpV4ProtocolHandler extends BaseProtocolHandler { } // END - if // Return result - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: isValid=' . intval($isValid) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: isValid=' . intval($isValid) . ' - EXIT!'); return $isValid; } diff --git a/application/hub/classes/helper/connection/class_BaseConnectionHelper.php b/application/hub/classes/helper/connection/class_BaseConnectionHelper.php index 78e2db83d..a40d1508c 100644 --- a/application/hub/classes/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/classes/helper/connection/class_BaseConnectionHelper.php @@ -221,7 +221,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable { */ private function getRawDataFromPackageArray (array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: currentFinalHash=' . $this->currentFinalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: currentFinalHash=' . $this->currentFinalHash); // Make sure the final hash is set assert((is_string($this->currentFinalHash)) && (!empty($this->currentFinalHash))); @@ -230,25 +230,25 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable { $rawDataChunk = $this->getFragmenterInstance()->getNextRawDataChunk($this->currentFinalHash); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: rawDataChunk=' . print_r($rawDataChunk, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: rawDataChunk=' . print_r($rawDataChunk, TRUE)); // Get chunk hashes and chunk data $chunkHashes = array_keys($rawDataChunk); $chunkData = array_values($rawDataChunk); // Is the required data there? - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: chunkHashes[]=' . count($chunkHashes) . ',chunkData[]=' . count($chunkData)); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('chunkData='.print_r($chunkData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: chunkHashes[]=' . count($chunkHashes) . ',chunkData[]=' . count($chunkData)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('chunkData='.print_r($chunkData, TRUE)); if ((isset($chunkHashes[0])) && (isset($chunkData[0]))) { // Remember this chunk as queued $this->queuedChunks[$chunkHashes[0]] = $chunkData[0]; // Return the raw data - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Returning ' . strlen($chunkData[0]) . ' bytes from ' . __METHOD__ . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Returning ' . strlen($chunkData[0]) . ' bytes from ' . __METHOD__ . ' ...'); return $chunkData[0]; } else { // Return zero string - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Returning zero bytes from ' . __METHOD__ . '!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Returning zero bytes from ' . __METHOD__ . '!'); return ''; } } @@ -281,7 +281,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable { // Is the final hash set? if ($finalHash !== TRUE) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Setting finalHash=' . $finalHash . ',currentFinalHash[' . gettype($this->currentFinalHash) . ']=' . $this->currentFinalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Setting finalHash=' . $finalHash . ',currentFinalHash[' . gettype($this->currentFinalHash) . ']=' . $this->currentFinalHash); // Set final hash $this->currentFinalHash = $finalHash; @@ -297,11 +297,11 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable { // Fill sending buffer with data while (strlen($dataStream) > 0) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: packageData=' . print_r($packageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: packageData=' . print_r($packageData, TRUE)); // Convert the package data array to a raw data stream $dataStream = $this->getRawDataFromPackageArray($packageData); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); $rawData .= $dataStream; } // END - while @@ -315,7 +315,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable { $encodedData = $this->getOutputStreamInstance()->streamData($rawData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[]=' . gettype($this->getSocketResource()) . PHP_EOL); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[]=' . gettype($this->getSocketResource()) . PHP_EOL); // Init array $encodedDataArray = array( @@ -340,7 +340,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable { * @return $shuttedDown Whether this connection is shutted down */ public final function isShuttedDown () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $this->__toString() . ',shuttedDown=' . intval($this->shuttedDown)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $this->__toString() . ',shuttedDown=' . intval($this->shuttedDown)); return $this->shuttedDown; } } diff --git a/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php b/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php index 07f94a6e1..e045925fa 100644 --- a/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php +++ b/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php @@ -118,7 +118,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $timeout = $this->getConfigInstance()->getConfigEntry('socket_timeout_seconds'); // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Trying to connect to ' . $unlData[UniversalNodeLocator::UNL_PART_ADDRESS] . ':' . $unlData[UniversalNodeLocator::UNL_PART_PORT] . ' with socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Trying to connect to ' . $unlData[UniversalNodeLocator::UNL_PART_ADDRESS] . ':' . $unlData[UniversalNodeLocator::UNL_PART_PORT] . ' with socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' ...'); // Get current time $hasTimedOut = FALSE; @@ -130,14 +130,14 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $socketError = socket_last_error($socketResource); // Log error code and status - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketError=' . $socketError . ',isConnected=' . intval($isConnected)); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketError=' . $socketError . ',isConnected=' . intval($isConnected)); // Skip any errors which may happen on non-blocking connections if (($socketError == SOCKET_EINPROGRESS) || ($socketError == SOCKET_EALREADY)) { // Now, is that attempt within parameters? if ((time() - $time) >= $timeout) { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: timeout=' . $timeout .' reached, connection attempt failed.'); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: timeout=' . $timeout .' reached, connection attempt failed.'); // Didn't work within timeout $isConnected = FALSE; @@ -149,7 +149,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->idle(1000); } elseif ($socketError != 0) { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketError=' . $socketError . ' detected.'); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketError=' . $socketError . ' detected.'); // Stop on everything else pronto $isConnected = FALSE; @@ -158,7 +158,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { } // END - while // Log error code - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketError=' . $socketError . ',isConnected=' . intval($isConnected) . ',hasTimedOut=' . intval($hasTimedOut) . ' after while() loop.'); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: socketError=' . $socketError . ',isConnected=' . intval($isConnected) . ',hasTimedOut=' . intval($hasTimedOut) . ' after while() loop.'); /* * All IPv4-based connections are non-blocking used by this program or @@ -168,7 +168,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { */ if (($hasTimedOut === FALSE) && ($socketError == SOCKET_EINPROGRESS)) { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Clearing "operation in progress" as this is for 99.999% chance a non-blocking I/O operation.'); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Clearing "operation in progress" as this is for 99.999% chance a non-blocking I/O operation.'); // A "connection in progress" has not timed out. All fine. $isConnected = TRUE; @@ -199,7 +199,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { * @return void */ protected final function markConnectionShuttedDown () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $this->__toString() . ' has been marked as shutted down'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: ' . $this->__toString() . ' has been marked as shutted down'); $this->shuttedDown = TRUE; // And remove the (now invalid) socket @@ -358,7 +358,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { * @return void */ protected function socketErrorOperationInProgressHandler ($socketResource, array $unlData) { - self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Operation is now in progress, this is usual for non-blocking connections and is no bug.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Operation is now in progress, this is usual for non-blocking connections and is no bug.'); } } diff --git a/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php b/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php index 9ff36c3df..fe8ac3f11 100644 --- a/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php +++ b/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php @@ -84,7 +84,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Setting socket resource ... (' . gettype($socketResource) . ')'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Setting socket resource ... (' . gettype($socketResource) . ')'); // Set the resource $helperInstance->setSocketResource($socketResource); @@ -113,7 +113,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection $helperInstance->setHandlerInstance($handlerInstance); } catch (NoValidHostnameException $e) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Failed to resolve ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ':' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Failed to resolve ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ':' . $e->getMessage()); // Is the recipient equal as configured IP if (substr($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], 0, strlen($helperInstance->getConfigInstance()->getConfigEntry('external_address'))) == $helperInstance->getConfigInstance()->getConfigEntry('external_address')) { @@ -146,7 +146,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection // Now connect to it if (!$helperInstance->connectToPeerByUnlData($unlData)) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ',unlData=' . print_r($unlData, TRUE)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ',unlData=' . print_r($unlData, TRUE)); // Handle socket error $helperInstance->handleSocketError(__METHOD__, __LINE__, $socketResource, $unlData); @@ -165,7 +165,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection */ public function doShutdown () { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down socket resource ' . $this->getSocketResource()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down socket resource ' . $this->getSocketResource()); // Clear any previous errors socket_clear_error($this->getSocketResource()); diff --git a/application/hub/classes/helper/dht/class_DhtBootstrapHelper.php b/application/hub/classes/helper/dht/class_DhtBootstrapHelper.php index 370afe301..61dfa6b2b 100644 --- a/application/hub/classes/helper/dht/class_DhtBootstrapHelper.php +++ b/application/hub/classes/helper/dht/class_DhtBootstrapHelper.php @@ -66,7 +66,7 @@ class DhtBootstrapHelper extends BaseHubSystemHelper implements HelpableDht { */ public function loadDescriptorXml (Distributable $dhtInstance) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Starting with DHT boostrap ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Starting with DHT boostrap ...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('dht_bootstrap_template_class'); @@ -89,7 +89,7 @@ class DhtBootstrapHelper extends BaseHubSystemHelper implements HelpableDht { */ public function sendPackage (Distributable $dhtInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); /* * Sanity check: Is the DHT in the approx. state? 'init' for bootstrap @@ -108,7 +108,7 @@ class DhtBootstrapHelper extends BaseHubSystemHelper implements HelpableDht { $packageInstance->enqueueRawDataFromTemplate($this); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } } diff --git a/application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php b/application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php index 6219ff6cd..331ff9a7b 100644 --- a/application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php +++ b/application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php @@ -66,7 +66,7 @@ class DhtPublishEntryHelper extends BaseHubSystemHelper implements HelpableDht { */ public function loadDescriptorXml (Distributable $dhtInstance) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Starting with publishing an entry ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Starting with publishing an entry ...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('dht_publish_entry_template_class'); diff --git a/application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php b/application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php index eb4f6d1e1..88d1b4e92 100644 --- a/application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php +++ b/application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php @@ -60,7 +60,7 @@ class NodeAnnouncementHelper extends BaseNodeHelper implements HelpableNode { */ public function loadDescriptorXml (NodeHelper $nodeInstance) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Starting with announcement to upper hubs...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Starting with announcement to upper hubs...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_template_class'); diff --git a/application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php b/application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php index 1ae11467d..b60901c35 100644 --- a/application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php +++ b/application/hub/classes/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php @@ -64,7 +64,7 @@ class NodeAnnouncementMessageAnswerHelper extends BaseHubAnswerHelper implements */ public function loadDescriptorXml (NodeHelper $nodeInstance) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting to answer an announcement...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting to answer an announcement...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_answer_template_class'); diff --git a/application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php b/application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php index 07d9e041c..a440ee05b 100644 --- a/application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php +++ b/application/hub/classes/helper/node/answer/dht/class_NodeDhtBootstrapMessageAnswerHelper.php @@ -64,7 +64,7 @@ class NodeDhtBootstrapMessageAnswerHelper extends BaseHubAnswerHelper implements */ public function loadDescriptorXml (NodeHelper $nodeInstance) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting to answer a DHT bootstrap request...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting to answer a DHT bootstrap request...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_dht_bootstrap_answer_template_class'); diff --git a/application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php b/application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php index 5f391a0fc..43788ae1f 100644 --- a/application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php +++ b/application/hub/classes/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php @@ -64,7 +64,7 @@ class NodeRequestNodeListMessageAnswerHelper extends BaseHubAnswerHelper impleme */ public function loadDescriptorXml (NodeHelper $nodeInstance) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting to answer a request: node-list...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting to answer a request: node-list...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_request_node_list_answer_template_class'); diff --git a/application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php b/application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php index ed9d5cb1c..29e83cc45 100644 --- a/application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php +++ b/application/hub/classes/helper/node/connection/class_NodeSelfConnectHelper.php @@ -60,7 +60,7 @@ class NodeSelfConnectHelper extends BaseNodeHelper implements HelpableNode { */ public function loadDescriptorXml (NodeHelper $nodeInstance) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting self-connect...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting self-connect...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_self_connect_template_class'); diff --git a/application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php b/application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php index e674c326e..7e82ca174 100644 --- a/application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php +++ b/application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php @@ -60,7 +60,7 @@ class NodeRequestNodeListHelper extends BaseNodeHelper implements HelpableNode { */ public function loadDescriptorXml (NodeHelper $nodeInstance) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting to request: node-list...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Attempting to request: node-list...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_request_node_list_template_class'); diff --git a/application/hub/classes/info/connection/class_ConnectionInfo.php b/application/hub/classes/info/connection/class_ConnectionInfo.php index f9751b569..f3e4bfb06 100644 --- a/application/hub/classes/info/connection/class_ConnectionInfo.php +++ b/application/hub/classes/info/connection/class_ConnectionInfo.php @@ -53,7 +53,7 @@ class ConnectionInfo extends BaseInfo implements ShareableInfo, Registerable { */ public function fillWithListenerInformation (Listenable $listenerInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $listenerInstance->getProtocolName() . ',listenerInstance=' . $listenerInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $listenerInstance->getProtocolName() . ',listenerInstance=' . $listenerInstance->__toString() . ' - CALLED!'); // Fill the generic array with several data from the listener: $this->setProtocolName($listenerInstance->getProtocolName()); @@ -64,7 +64,7 @@ class ConnectionInfo extends BaseInfo implements ShareableInfo, Registerable { $this->setListenerInstance($listenerInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -75,7 +75,7 @@ class ConnectionInfo extends BaseInfo implements ShareableInfo, Registerable { */ public function fillWithConnectionHelperInformation (ConnectionHelper $helperInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $helperInstance->getProtocolName() . ',helperInstance=' . $helperInstance->__toString() . ',socketResource=' . $helperInstance->getSocketResource() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: protocolName=' . $helperInstance->getProtocolName() . ',helperInstance=' . $helperInstance->__toString() . ',socketResource=' . $helperInstance->getSocketResource() . ' - CALLED!'); // Fill the generic array with several data from the listener: $this->setProtocolName($helperInstance->getProtocolName()); @@ -86,7 +86,7 @@ class ConnectionInfo extends BaseInfo implements ShareableInfo, Registerable { $this->setHelperInstance($helperInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** diff --git a/application/hub/classes/iterator/producer/keys/class_TestUnitKeyProducerIterator.php b/application/hub/classes/iterator/producer/keys/class_TestUnitKeyProducerIterator.php index ce2c1411d..ea8c48beb 100644 --- a/application/hub/classes/iterator/producer/keys/class_TestUnitKeyProducerIterator.php +++ b/application/hub/classes/iterator/producer/keys/class_TestUnitKeyProducerIterator.php @@ -56,7 +56,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator { $this->maxBits = pow(2, $this->keyLength); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('ITERATOR: maxBits=' . $this->maxBits . ',keyLength=' . $this->keyLength . ' bits'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ITERATOR: maxBits=' . $this->maxBits . ',keyLength=' . $this->keyLength . ' bits'); } /** diff --git a/application/hub/classes/listener/tcp/class_TcpListener.php b/application/hub/classes/listener/tcp/class_TcpListener.php index c0539b83a..73d4b7089 100644 --- a/application/hub/classes/listener/tcp/class_TcpListener.php +++ b/application/hub/classes/listener/tcp/class_TcpListener.php @@ -101,7 +101,7 @@ class TcpListener extends BaseListener implements Listenable { * that all connections on this port are now our resposibility to * send/recv data, disconnect, etc.. */ - self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Binding to address ' . $this->getListenAddress() . ':' . $this->getListenPort()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Binding to address ' . $this->getListenAddress() . ':' . $this->getListenPort()); if (!socket_bind($mainSocket, $this->getListenAddress(), $this->getListenPort())) { // Handle this socket error with a faked recipientData array $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0')); @@ -121,7 +121,7 @@ class TcpListener extends BaseListener implements Listenable { } // END - if // Start listen for connections - self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Listening for connections.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-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('0.0.0.0', '0')); @@ -141,7 +141,7 @@ class TcpListener extends BaseListener implements Listenable { } // END - if // Now, we want non-blocking mode - self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Setting non-blocking mode.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-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('0.0.0.0', '0')); @@ -186,7 +186,7 @@ class TcpListener extends BaseListener implements Listenable { $this->setHandlerInstance($handlerInstance); // Output message - self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: TCP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: TCP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.'); } /** diff --git a/application/hub/classes/listener/udp/class_UdpListener.php b/application/hub/classes/listener/udp/class_UdpListener.php index a5aff183e..91f976889 100644 --- a/application/hub/classes/listener/udp/class_UdpListener.php +++ b/application/hub/classes/listener/udp/class_UdpListener.php @@ -70,7 +70,7 @@ class UdpListener extends BaseListener implements Listenable { * that all connections on this port are now our resposibility to * send/recv data, disconnect, etc.. */ - self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Binding to address ' . $this->getListenAddress() . ':' . $this->getListenPort()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Binding to address ' . $this->getListenAddress() . ':' . $this->getListenPort()); if (!socket_bind($mainSocket, $this->getListenAddress(), $this->getListenPort())) { // Handle the socket error with a faked recipientData array $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0')); @@ -90,7 +90,7 @@ class UdpListener extends BaseListener implements Listenable { } // END - if // Now, we want non-blocking mode - self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Setting non-blocking mode.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Setting non-blocking mode.'); if (!socket_set_nonblock($mainSocket)) { // Handle the socket error with a faked recipientData array $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0')); @@ -110,7 +110,7 @@ class UdpListener extends BaseListener implements Listenable { } // END - if // Set the option to reuse the port - self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Setting re-use address option.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Setting re-use address option.'); if (!socket_set_option($mainSocket, SOL_SOCKET, SO_REUSEADDR, 1)) { // Handle the socket error with a faked recipientData array $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0')); @@ -139,7 +139,7 @@ class UdpListener extends BaseListener implements Listenable { $this->setHandlerInstance($handlerInstance); // Output message - self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.'); } /** @@ -169,7 +169,7 @@ class UdpListener extends BaseListener implements Listenable { return; } elseif ($lastError > 0) { // Other error detected - self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Error detected: ' . socket_strerror($lastError)); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Error detected: ' . socket_strerror($lastError)); // Skip further processing return; @@ -179,7 +179,7 @@ class UdpListener extends BaseListener implements Listenable { } // END - if // Debug only - self::createDebugInstance(__CLASS__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Handling UDP package with size ' . strlen($rawData) . ' from peer ' . $peer . ':' . $port); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UDP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: Handling UDP package with size ' . strlen($rawData) . ' from peer ' . $peer . ':' . $port); } /** diff --git a/application/hub/classes/miner/chash/class_HubCoinMiner.php b/application/hub/classes/miner/chash/class_HubCoinMiner.php index 2b9ddb1d7..f6caeee45 100644 --- a/application/hub/classes/miner/chash/class_HubCoinMiner.php +++ b/application/hub/classes/miner/chash/class_HubCoinMiner.php @@ -119,14 +119,14 @@ class HubCoinMiner extends BaseHubMiner implements MinerHelper, Registerable { */ public function outputConsoleTeaser () { // Output all lines - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('Hubcoin miner v' . $this->getVersion() . ' is starting ...'); - self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2014 Miner Developer Team'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); - self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); - self::createDebugInstance(__CLASS__)->debugOutput('conditions; see docs/COPYING for details.'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Hubcoin miner v' . $this->getVersion() . ' is starting ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Copyright (c) 2014 Miner Developer Team'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('conditions; see docs/COPYING for details.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); } /** diff --git a/application/hub/classes/miner/class_BaseHubMiner.php b/application/hub/classes/miner/class_BaseHubMiner.php index 6ede03bce..e4cec8cb7 100644 --- a/application/hub/classes/miner/class_BaseHubMiner.php +++ b/application/hub/classes/miner/class_BaseHubMiner.php @@ -186,7 +186,7 @@ abstract class BaseHubMiner extends BaseHubSystem implements Updateable { )); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('MINER: All buffers are now initialized.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MINER: All buffers are now initialized.'); } /** diff --git a/application/hub/classes/nodes/boot/class_HubBootNode.php b/application/hub/classes/nodes/boot/class_HubBootNode.php index 62342384d..8102f926e 100644 --- a/application/hub/classes/nodes/boot/class_HubBootNode.php +++ b/application/hub/classes/nodes/boot/class_HubBootNode.php @@ -62,7 +62,7 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable { $unl = $this->detectOwnUniversalNodeLocator(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl); // Now check if the IP address matches one of the bootstrap nodes if ($this->ifAddressMatchesBootstrapNodes($unl)) { @@ -75,23 +75,23 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable { // Is the port the same? if ($bootPort == $ourPort) { // It is the same! - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: UNL matches bootstrap node ' . $this->getBootUniversalNodeLocator() . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: UNL matches bootstrap node ' . $this->getBootUniversalNodeLocator() . '.'); // Now, does the mode match if ($this->getRequestInstance()->getRequestElement('mode') == self::NODE_TYPE_BOOT) { // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Our node is a valid bootstrap node.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Our node is a valid bootstrap node.'); } else { // Output warning - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=' . BaseHubNode::NODE_TYPE_BOOT . ' detected.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=' . BaseHubNode::NODE_TYPE_BOOT . ' detected.'); } } else { // IP does match, but no port - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: WARNING: Our UNL ' . $unl . ' does match a known bootstrap-node but not the port ' . $ourPort . '/' . $bootPort . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: WARNING: Our UNL ' . $unl . ' does match a known bootstrap-node but not the port ' . $ourPort . '/' . $bootPort . '.'); } } else { // Node does not match any know bootstrap-node - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: WARNING: Our UNL ' . $unl . ' does not match any known bootstrap-nodes.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: WARNING: Our UNL ' . $unl . ' does not match any known bootstrap-nodes.'); } // Enable acceptance of announcements diff --git a/application/hub/classes/nodes/class_BaseHubNode.php b/application/hub/classes/nodes/class_BaseHubNode.php index f58fa3f68..ae2f9a51d 100644 --- a/application/hub/classes/nodes/class_BaseHubNode.php +++ b/application/hub/classes/nodes/class_BaseHubNode.php @@ -132,7 +132,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->getWrapperInstance()->registerPrivateKey($this, $this->getRequestInstance(), $searchInstance); // Output message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Created new private key with hash: ' . $this->getPrivateKeyHash() . ''); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Created new private key with hash: ' . $this->getPrivateKeyHash() . ''); } /** @@ -187,7 +187,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->bootUnl = $unl; // Output message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: UNL matches remote address ' . $unl . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: UNL matches remote address ' . $unl . '.'); // Stop further searching break; @@ -202,7 +202,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->bootUnl = $unl; // Output message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: UNL matches listen address ' . $unl . '.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __METHOD__ . ':' . __LINE__ . ']: UNL matches listen address ' . $unl . '.'); // Stop further searching break; @@ -249,14 +249,14 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $app = $this->getApplicationInstance(); // Output all lines - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' mode active'); - self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2015 Hub Developer Team'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); - self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); - self::createDebugInstance(__CLASS__)->debugOutput('conditions; see docs/COPYING for details.'); - self::createDebugInstance(__CLASS__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' mode active'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2015 Hub Developer Team'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('This is free software, and you are welcome to redistribute it under certain'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('conditions; see docs/COPYING for details.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(' '); } /** @@ -275,7 +275,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->setNodeId($this->getField(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_ID)); // Output message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Re-using found node-id: ' . $this->getNodeId() . ''); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Re-using found node-id: ' . $this->getNodeId() . ''); } else { // Get an RNG instance $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class'); @@ -290,7 +290,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->getWrapperInstance()->registerNodeId($this, $this->getRequestInstance()); // Output message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Created new node-id: ' . $this->getNodeId() . ''); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Created new node-id: ' . $this->getNodeId() . ''); } } @@ -322,7 +322,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->getWrapperInstance()->registerSessionId($this, $this->getRequestInstance(), $searchInstance); // Output message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Created new session-id: ' . $this->getSessionId() . ''); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Created new session-id: ' . $this->getSessionId() . ''); // Change the state because the node has aquired a session id $this->getStateInstance()->nodeGeneratedSessionId(); @@ -350,7 +350,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->setPrivateKeyHash($this->getField(NodeInformationDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH)); // Output message - self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Re-using found private key hash: ' . $this->getPrivateKeyHash() . ''); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Re-using found private key hash: ' . $this->getPrivateKeyHash() . ''); } } else { /* @@ -452,7 +452,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { } // END - if // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('HUB-Announcement: START (taskInstance=' . $taskInstance->__toString(). ')'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-Announcement: START (taskInstance=' . $taskInstance->__toString(). ')'); // Get a helper instance $helperInstance = ObjectFactory::createObjectByConfiguredName('node_announcement_helper_class'); @@ -470,7 +470,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->getStateInstance()->nodeAnnouncingToUpperHubs(); // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('HUB-Announcement: FINISHED'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-Announcement: FINISHED'); } /** @@ -483,7 +483,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ public function doSelfConnection (Taskable $taskInstance) { // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Self Connection: START (taskInstance=' . $taskInstance->__toString(). ')'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Self Connection: START (taskInstance=' . $taskInstance->__toString(). ')'); // Get a helper instance $helperInstance = ObjectFactory::createObjectByConfiguredName('node_self_connect_helper_class', array($this)); @@ -498,7 +498,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $helperInstance->sendPackage($this); // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Self Connection: FINISHED'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Self Connection: FINISHED'); } /** @@ -536,7 +536,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ public function initializeListenerPool () { // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Initialize listener: START'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Initialize listener: START'); // Get a new pool instance $this->setListenerPoolInstance(ObjectFactory::createObjectByConfiguredName('listener_pool_class', array($this))); @@ -608,7 +608,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $this->getListenerPoolInstance()->addListener($decoratorInstance); // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Initialize listener: FINISHED.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Initialize listener: FINISHED.'); } /** @@ -664,13 +664,13 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ public function ifNodeIsAnnouncing () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeIsAnnouncing(): state=' . $this->getStateInstance()->getStateName()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeIsAnnouncing(): state=' . $this->getStateInstance()->getStateName()); // Simply check the state of this node $hasAnnounced = ($this->getStateInstance() instanceof NodeAnnouncingState); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeIsAnnouncing(): hasAnnounced=' . intval($hasAnnounced)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeIsAnnouncing(): hasAnnounced=' . intval($hasAnnounced)); // Return it return $hasAnnounced; @@ -684,13 +684,13 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ public function ifNodeHasAnnouncementCompleted () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeHasAnnouncementCompleted(): state=' . $this->getStateInstance()->getStateName()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeHasAnnouncementCompleted(): state=' . $this->getStateInstance()->getStateName()); // Simply check the state of this node $hasAnnouncementCompleted = ($this->getStateInstance() instanceof NodeAnnouncementCompletedState); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeHasAnnouncementCompleted(): hasAnnouncementCompleted=' . intval($hasAnnouncementCompleted)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: ifNodeHasAnnouncementCompleted(): hasAnnouncementCompleted=' . intval($hasAnnouncementCompleted)); // Return it return $hasAnnouncementCompleted; @@ -713,7 +713,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { * @return void */ public final function enableAcceptDhtBootstrap ($acceptDhtBootstrap = TRUE) { - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Enabling DHT bootstrap requests ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Enabling DHT bootstrap requests ...'); $this->acceptDhtBootstrap = $acceptDhtBootstrap; } @@ -741,7 +741,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ public function determineUniversalNodeLocator () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Determine UNL based on this node: // 1) Get discovery class @@ -751,7 +751,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $unlInstance = $discoveryInstance->discoverUniversalNodeLocatorByNode($this); // 3) Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unlInstance= ' . $unlInstance->__toString() . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unlInstance= ' . $unlInstance->__toString() . ' - EXIT!'); return $unlInstance; } @@ -762,7 +762,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ public final function getUniversalNodeLocatorArray () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Get the Universal Node Locator (UNL) instance $unlInstance = $this->determineUniversalNodeLocator(); @@ -777,7 +777,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $unlData = $unlInstance->getUnlData(); // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); return $unlData; } @@ -846,7 +846,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { $dataSetInstance->addCriteria($element, $nodeData[$element]); } else { // Output warning message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: addArrayToDataSet(): Element ' . $element . ' not found in nodeData array.'); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: addArrayToDataSet(): Element ' . $element . ' not found in nodeData array.'); } } // END - foreac } diff --git a/application/hub/classes/package/assembler/class_PackageAssembler.php b/application/hub/classes/package/assembler/class_PackageAssembler.php index e85d72c2a..c1b21928f 100644 --- a/application/hub/classes/package/assembler/class_PackageAssembler.php +++ b/application/hub/classes/package/assembler/class_PackageAssembler.php @@ -105,7 +105,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, $isInputBufferEmpty = $this->getPackageInstance()->getStackInstance()->isStackEmpty(NetworkPackage::STACKER_NAME_DECODED_HANDLED); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: isInputBufferEmpty=' . intval($isInputBufferEmpty)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: isInputBufferEmpty=' . intval($isInputBufferEmpty)); // Return it return $isInputBufferEmpty; @@ -174,7 +174,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, */ private function handlePackageByUnhandledPackage (array $packageContent) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: packageData[' . BaseRawDataHandler::PACKAGE_RAW_DATA . ']=' . $packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: packageData[' . BaseRawDataHandler::PACKAGE_RAW_DATA . ']=' . $packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]); // Check for some conditions if ((!$this->ifInputBufferIsEmpty()) || (!$this->isPackageContentCompleted($packageContent))) { @@ -182,10 +182,10 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, $this->pendingData .= $packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Partial data received. Waiting for more ... ( ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes)'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Partial data received. Waiting for more ... ( ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes)'); } else { // Debug message - //* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ': packageContent=' . print_r($packageContent, TRUE) . ',chunks='.print_r($chunks, TRUE)); + //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ': packageContent=' . print_r($packageContent, TRUE) . ',chunks='.print_r($chunks, TRUE)); } } @@ -213,7 +213,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, $isPending = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_MULTIPLE_MESSAGE)); // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ': isPending=' . intval($isPending)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ': isPending=' . intval($isPending)); return $isPending; } @@ -224,7 +224,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, */ public function handlePendingData () { // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Going to decode ' . strlen($this->pendingData) . ' Bytes of pending data. pendingData=' . $this->pendingData); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Going to decode ' . strlen($this->pendingData) . ' Bytes of pending data. pendingData=' . $this->pendingData); // Assert on condition assert(!$this->isPendingDataEmpty()); @@ -232,8 +232,8 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, // No markers set? if (!$this->ifStartEndMarkersSet($this->pendingData)) { // This will cause an assertition in next call, so simply wait for more data - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Pending data of ' . strlen($this->pendingData) . ' Bytes are incomplete, waiting for more ...'); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: this->pendingData=' . $this->pendingData); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Pending data of ' . strlen($this->pendingData) . ' Bytes are incomplete, waiting for more ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: this->pendingData=' . $this->pendingData); return; } elseif (substr_count($this->pendingData, BaseRawDataHandler::STREAM_START_MARKER) > 1) { /* @@ -268,7 +268,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, $this->clearPendingData(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Last block of partial data received. A total of ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes has been received.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Last block of partial data received. A total of ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes has been received.'); // Make sure last CHUNK_SEPARATOR is not there if (substr($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA], -1, 1) == PackageFragmenter::CHUNK_SEPARATOR) { @@ -284,7 +284,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, $chunks = explode(PackageFragmenter::CHUNK_SEPARATOR, $packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]); // Add all chunks because the last final chunk is found - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Going to add ' . count($chunks) . ' to chunk handler ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-ASSEMBLER[' . __METHOD__ . ':' . __LINE__ . ']: Going to add ' . count($chunks) . ' to chunk handler ...'); $this->getHandlerInstance()->addAllChunksWithFinal($chunks); } diff --git a/application/hub/classes/package/class_NetworkPackage.php b/application/hub/classes/package/class_NetworkPackage.php index 1b75aa984..b618a2b46 100644 --- a/application/hub/classes/package/class_NetworkPackage.php +++ b/application/hub/classes/package/class_NetworkPackage.php @@ -372,7 +372,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R // Is an entry found? if (count($senderData) > 0) { // Make sure the element 'private_key_hash' is there - //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: senderData=' . print_r($senderData, TRUE)); + //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: senderData=' . print_r($senderData, TRUE)); assert(isset($senderData[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_PRIVATE_KEY_HASH])); // Don't accept empty hashes @@ -407,7 +407,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ private function getHashFromContent ($content) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: content[md5]=' . md5($content) . ',sender=' . $this->getSessionId() . ',compressor=' . $this->getCompressorInstance()->getCompressorExtension()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: content[md5]=' . md5($content) . ',sender=' . $this->getSessionId() . ',compressor=' . $this->getCompressorInstance()->getCompressorExtension()); // Create the hash // @TODO md5() is very weak, but it needs to be fast @@ -420,7 +420,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R ); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: content[md5]=' . md5($content) . ',sender=' . $this->getSessionId() . ',hash=' . $hash . ',compressor=' . $this->getCompressorInstance()->getCompressorExtension()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: content[md5]=' . md5($content) . ',sender=' . $this->getSessionId() . ',hash=' . $hash . ',compressor=' . $this->getCompressorInstance()->getCompressorExtension()); // And return it return $hash; @@ -481,7 +481,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ public function getHashFromContentSessionId (array $decodedContent, $sessionId) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: content[md5]=' . md5($decodedContent[self::PACKAGE_CONTENT_MESSAGE]) . ',sender=' . $sessionId . ',compressor=' . $decodedContent[self::PACKAGE_CONTENT_EXTENSION]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: content[md5]=' . md5($decodedContent[self::PACKAGE_CONTENT_MESSAGE]) . ',sender=' . $sessionId . ',compressor=' . $decodedContent[self::PACKAGE_CONTENT_EXTENSION]); // Create the hash // @TODO md5() is very weak, but it needs to be fast @@ -537,7 +537,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $currentRecipient = $iteratorInstance->current(); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Setting recipient to ' . $currentRecipient . ',previous=' . $packageData[self::PACKAGE_DATA_RECIPIENT]); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Setting recipient to ' . $currentRecipient . ',previous=' . $packageData[self::PACKAGE_DATA_RECIPIENT]); // Set the recipient $packageData[self::PACKAGE_DATA_RECIPIENT] = $currentRecipient; @@ -546,7 +546,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECLARED, $packageData); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package declared for recipient ' . $currentRecipient); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package declared for recipient ' . $currentRecipient); // Skip to next entry $iteratorInstance->next(); @@ -588,11 +588,11 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $socketResource = $discoveryInstance->discoverSocket($packageData, BaseConnectionHelper::CONNECTION_TYPE_OUTGOING); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after discoverSocket() has been called.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after discoverSocket() has been called.'); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: stateInstance=' . $helperInstance->getStateInstance()); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' before isSocketRegistered() has been called.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: stateInstance=' . $helperInstance->getStateInstance()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' before isSocketRegistered() has been called.'); // The socket needs to be put in a special registry that can handle such data $registryInstance = SocketRegistryFactory::createSocketRegistryInstance(); @@ -612,32 +612,32 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R // Is it not there? if ((is_resource($socketResource)) && (!$registryInstance->isSocketRegistered($infoInstance, $socketResource))) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Registering socket ' . $socketResource . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Registering socket ' . $socketResource . ' ...'); // Then register it $registryInstance->registerSocket($infoInstance, $socketResource, $packageData); } elseif (!$helperInstance->getStateInstance()->isPeerStateConnected()) { // Is not connected, then we cannot send - self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Unexpected peer state ' . $helperInstance->getStateInstance()->__toString() . ' detected.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Unexpected peer state ' . $helperInstance->getStateInstance()->__toString() . ' detected.'); // Shutdown the socket $this->shutdownSocket($socketResource); } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after isSocketRegistered() has been called.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after isSocketRegistered() has been called.'); // Make sure the connection is up $helperInstance->getStateInstance()->validatePeerStateConnected(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after validatePeerStateConnected() has been called.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after validatePeerStateConnected() has been called.'); // Enqueue it again on the out-going queue, the connection is up and working at this point $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING, $packageData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after pushNamed() has been called.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Reached line ' . __LINE__ . ' after pushNamed() has been called.'); } /** @@ -684,12 +684,12 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ private function generatePackageHash ($content, $senderId) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: content()=' . strlen($content) . ',senderId=' . $senderId . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: content()=' . strlen($content) . ',senderId=' . $senderId . ' - CALLED!'); // Is the feature enabled? if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) { // Feature is not enabled - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Feature "hubcoin_reward" not available, not generating package hash. Returning NULL ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Feature "hubcoin_reward" not available, not generating package hash. Returning NULL ...'); return NULL; } // END - if @@ -701,11 +701,11 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R ); // Hash content and sender id together, use scrypt - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: senderId=' . $senderId . ',content()=' . strlen($content)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: senderId=' . $senderId . ',content()=' . strlen($content)); $hash = FrameworkFeature::callFeature('hubcoin_reward', 'generateHash', array($senderId . ':' . $content . ':' . $this->determineSenderPrivateKeyHash($data))); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash . ' - EXIT!'); // Return it return $hash; @@ -721,7 +721,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ private function isPackageHashValid (array $decodedArray) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: decodedArray=' . print_r($decodedArray, TRUE) . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: decodedArray=' . print_r($decodedArray, TRUE) . ' - CALLED!'); // Make sure the required array elements are there assert(isset($decodedArray[self::PACKAGE_CONTENT_SENDER])); @@ -732,17 +732,17 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R // Is the feature enabled? if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) { // Feature is not enabled, so hashes are always valid - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Feature "hubcoin_reward" not available, not checking hash. Returning TRUE ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Feature "hubcoin_reward" not available, not checking hash. Returning TRUE ...'); return TRUE; } // END - if // Check validity - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: senderId=' . $decodedArray[self::PACKAGE_CONTENT_SENDER] . ',message()=' . strlen($decodedArray[self::PACKAGE_CONTENT_MESSAGE]) . ',hash=' . $decodedArray[self::PACKAGE_CONTENT_HASH]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: senderId=' . $decodedArray[self::PACKAGE_CONTENT_SENDER] . ',message()=' . strlen($decodedArray[self::PACKAGE_CONTENT_MESSAGE]) . ',hash=' . $decodedArray[self::PACKAGE_CONTENT_HASH]); //* DEBUG-DIE: */ die(__METHOD__ . ': decodedArray=' . print_r($decodedArray, TRUE)); $isHashValid = FrameworkFeature::callFeature('hubcoin_reward', 'checkHash', array($decodedArray[self::PACKAGE_CONTENT_SENDER] . ':' . $decodedArray[self::PACKAGE_CONTENT_MESSAGE] . ':' . $this->determineSenderPrivateKeyHash($decodedArray), $decodedArray[self::PACKAGE_CONTENT_HASH])); // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: isHashValid=' . intval($isHashValid) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: isHashValid=' . intval($isHashValid) . ' - EXIT!'); return $isHashValid; } @@ -756,11 +756,11 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ public function enqueueRawDataFromTemplate (HubHelper $helperInstance) { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); // Get the raw content ... $content = $helperInstance->getTemplateInstance()->getRawTemplateData(); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('content(' . strlen($content) . ')=' . $content); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('content(' . strlen($content) . ')=' . $content); // ... and compress it $compressed = $this->getCompressorInstance()->compressStream($content); @@ -784,7 +784,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R ); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': Enqueueing package for recipientType=' . $helperInstance->getRecipientType() . ' ...'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': Enqueueing package for recipientType=' . $helperInstance->getRecipientType() . ' ...'); // Now prepare the temporary array and push it on the 'undeclared' stack $this->getStackInstance()->pushNamed(self::STACKER_NAME_UNDECLARED, array( @@ -797,7 +797,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R )); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); } /** @@ -864,12 +864,12 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ public function declareEnqueuedPackage () { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); // Make sure this method isn't working if there is no package enqueued if (!$this->isPackageEnqueued()) { // This is not fatal but should be avoided - self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: No raw package data waiting declaration, but ' . __METHOD__ . ' has been called!'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: No raw package data waiting declaration, but ' . __METHOD__ . ' has been called!'); return; } // END - if @@ -883,7 +883,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->declareRawPackageData($packageData); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); } /** @@ -895,12 +895,12 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ public function processDeclaredPackage () { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); // Sanity check if we have packages declared if (!$this->isPackageDeclared()) { // This is not fatal but should be avoided - self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: No package has been declared, but ' . __METHOD__ . ' has been called!'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: No package has been declared, but ' . __METHOD__ . ' has been called!'); return; } // END - if @@ -919,14 +919,14 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->getStackInstance()->popNamed(self::STACKER_NAME_DECLARED); } catch (UnexpectedStateException $e) { // The state is not excepected (shall be 'connected') - self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage()); // Mark the package with status failed $this->changePackageStatus($packageData, self::STACKER_NAME_DECLARED, self::PACKAGE_STATUS_FAILED); } // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); } /** @@ -936,12 +936,12 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ public function sendWaitingPackage () { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); // Sanity check if we have packages waiting for delivery if (!$this->isPackageWaitingForDelivery()) { // This is not fatal but should be avoided - self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: No package is waiting for delivery, but ' . __METHOD__ . ' was called.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: No package is waiting for delivery, but ' . __METHOD__ . ' was called.'); return; } // END - if @@ -956,14 +956,14 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->getStackInstance()->popNamed(self::STACKER_NAME_OUTGOING); } catch (InvalidSocketException $e) { // Output exception message - self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package was not delivered: ' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Package was not delivered: ' . $e->getMessage()); // Mark package as failed $this->changePackageStatus($packageData, self::STACKER_NAME_OUTGOING, self::PACKAGE_STATUS_FAILED); } // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); } /** @@ -973,7 +973,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ public function sendEncodedData () { // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': CALLED!'); // Make sure there is pending encoded data assert($this->isEncodedDataPending()); @@ -988,14 +988,14 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R assert(is_resource($encodedDataArray[self::RAW_SOCKET_INDEX])); // And deliver it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Sending out ' . strlen($encodedDataArray[self::RAW_ENCODED_DATA_INDEX]) . ' bytes,rawBufferSize=' . $encodedDataArray[self::RAW_BUFFER_SIZE_INDEX] . ',diff=' . $encodedDataArray[self::RAW_DIFF_INDEX]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Sending out ' . strlen($encodedDataArray[self::RAW_ENCODED_DATA_INDEX]) . ' bytes,rawBufferSize=' . $encodedDataArray[self::RAW_BUFFER_SIZE_INDEX] . ',diff=' . $encodedDataArray[self::RAW_DIFF_INDEX]); if ($encodedDataArray[self::RAW_DIFF_INDEX] >= 0) { // Send all out (encodedData is smaller than or equal buffer size) - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: MD5=' . md5(substr($encodedDataArray[self::RAW_ENCODED_DATA_INDEX], 0, ($encodedDataArray[self::RAW_BUFFER_SIZE_INDEX] - $encodedDataArray[self::RAW_DIFF_INDEX])))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: MD5=' . md5(substr($encodedDataArray[self::RAW_ENCODED_DATA_INDEX], 0, ($encodedDataArray[self::RAW_BUFFER_SIZE_INDEX] - $encodedDataArray[self::RAW_DIFF_INDEX])))); $sentBytes = @socket_write($encodedDataArray[self::RAW_SOCKET_INDEX], $encodedDataArray[self::RAW_ENCODED_DATA_INDEX], ($encodedDataArray[self::RAW_BUFFER_SIZE_INDEX] - $encodedDataArray[self::RAW_DIFF_INDEX])); } else { // Send buffer size out - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: MD5=' . md5(substr($encodedDataArray[self::RAW_ENCODED_DATA_INDEX], 0, $encodedDataArray[self::RAW_BUFFER_SIZE_INDEX]))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: MD5=' . md5(substr($encodedDataArray[self::RAW_ENCODED_DATA_INDEX], 0, $encodedDataArray[self::RAW_BUFFER_SIZE_INDEX]))); $sentBytes = @socket_write($encodedDataArray[self::RAW_SOCKET_INDEX], $encodedDataArray[self::RAW_ENCODED_DATA_INDEX], $encodedDataArray[self::RAW_BUFFER_SIZE_INDEX]); } @@ -1008,7 +1008,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R throw new InvalidSocketException(array($this, $encodedDataArray[self::RAW_SOCKET_INDEX], $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } elseif (($sentBytes === 0) && (strlen($encodedDataArray[self::RAW_ENCODED_DATA_INDEX]) > 0)) { // Nothing sent means we are done - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); return; } else { // The difference between sent bytes and length of raw data should not go below zero @@ -1018,7 +1018,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $encodedDataArray[self::RAW_SENT_BYTES_INDEX] += $sentBytes; // Cut out the last unsent bytes - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Sent out ' . $sentBytes . ' of ' . strlen($encodedDataArray[self::RAW_ENCODED_DATA_INDEX]) . ' bytes ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: Sent out ' . $sentBytes . ' of ' . strlen($encodedDataArray[self::RAW_ENCODED_DATA_INDEX]) . ' bytes ...'); $encodedDataArray[self::RAW_ENCODED_DATA_INDEX] = substr($encodedDataArray[self::RAW_ENCODED_DATA_INDEX], $sentBytes); // Calculate difference again @@ -1027,7 +1027,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R // Can we abort? if (strlen($encodedDataArray[self::RAW_ENCODED_DATA_INDEX]) <= 0) { // Abort here, all sent! - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); return; } // END - if } @@ -1036,7 +1036,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING_STREAM, $encodedDataArray); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ': EXIT!'); } /////////////////////////////////////////////////////////////////////////// @@ -1086,12 +1086,12 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ if (!$this->isRawDataPending()) { // This is not fatal but should be avoided - self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: No raw (decoded?) data is pending, but ' . __METHOD__ . ' has been called!'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: No raw (decoded?) data is pending, but ' . __METHOD__ . ' has been called!'); return; } // END - if // Very noisy debug message: - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Stacker size is ' . $this->getStackInstance()->getStackCount(self::STACKER_NAME_DECODED_INCOMING) . ' entries.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Stacker size is ' . $this->getStackInstance()->getStackCount(self::STACKER_NAME_DECODED_INCOMING) . ' entries.'); // "Pop" the next entry (the same array again) from the stack $decodedData = $this->getStackInstance()->popNamed(self::STACKER_NAME_DECODED_INCOMING); @@ -1107,7 +1107,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R * Also make sure the error code is SOCKET_ERROR_UNHANDLED because we * only want to handle unhandled packages here. */ - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: errorCode=' . $decodedData[BaseRawDataHandler::PACKAGE_ERROR_CODE] . '(' . BaseRawDataHandler::SOCKET_ERROR_UNHANDLED . ')'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: errorCode=' . $decodedData[BaseRawDataHandler::PACKAGE_ERROR_CODE] . '(' . BaseRawDataHandler::SOCKET_ERROR_UNHANDLED . ')'); assert($decodedData[BaseRawDataHandler::PACKAGE_ERROR_CODE] == BaseRawDataHandler::SOCKET_ERROR_UNHANDLED); // Remove the last chunk SEPARATOR (because there is no need for it) @@ -1117,7 +1117,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R } // END - if // This package is "handled" and can be pushed on the next stack - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($decodedData[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes to stack ' . self::STACKER_NAME_DECODED_HANDLED . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($decodedData[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes to stack ' . self::STACKER_NAME_DECODED_HANDLED . ' ...'); $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_HANDLED, $decodedData); } @@ -1135,7 +1135,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $decodedData = $handlerInstance->getNextRawData(); // Very noisy debug message: - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: decodedData[' . gettype($decodedData) . ']=' . print_r($decodedData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: decodedData[' . gettype($decodedData) . ']=' . print_r($decodedData, TRUE)); // And push it on our stack $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_INCOMING, $decodedData); @@ -1229,7 +1229,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->getStackInstance()->popNamed(self::STACKER_NAME_DECODED_HANDLED); // ... and push it on the 'chunked' stacker - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes on stack ' . self::STACKER_NAME_DECODED_CHUNKED . ',packageContent=' . print_r($packageContent, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Pushing ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes on stack ' . self::STACKER_NAME_DECODED_CHUNKED . ',packageContent=' . print_r($packageContent, TRUE)); $this->getStackInstance()->pushNamed(self::STACKER_NAME_DECODED_CHUNKED, $packageContent); } @@ -1241,7 +1241,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ public function accept (Visitor $visitorInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - CALLED!'); // Visit the package $visitorInstance->visitNetworkPackage($this); @@ -1250,7 +1250,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->getAssemblerInstance()->accept($visitorInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - EXIT!'); } /** @@ -1263,7 +1263,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->initStacks(TRUE); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: All stacker have been re-initialized.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: All stacker have been re-initialized.'); } /** @@ -1447,7 +1447,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $messageArray[self::MESSAGE_ARRAY_DATA][self::MESSAGE_ARRAY_TYPE] = $messageArray[self::MESSAGE_ARRAY_TYPE]; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: messageArray=' . print_r($messageArray, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: messageArray=' . print_r($messageArray, TRUE)); // Create a handler instance from given message type $handlerInstance = MessageTypeHandlerFactory::createMessageTypeHandlerInstance($messageArray[self::MESSAGE_ARRAY_TYPE]); @@ -1492,7 +1492,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R unset($messageData[self::MESSAGE_ARRAY_DATA]); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE)); // Resolve session id ('sender' is a session id) into node id $nodeId = HubTools::resolveNodeIdBySessionId($messageData[self::MESSAGE_ARRAY_SENDER]); diff --git a/application/hub/classes/package/fragmenter/class_PackageFragmenter.php b/application/hub/classes/package/fragmenter/class_PackageFragmenter.php index c9337d39e..f98f191bf 100644 --- a/application/hub/classes/package/fragmenter/class_PackageFragmenter.php +++ b/application/hub/classes/package/fragmenter/class_PackageFragmenter.php @@ -226,7 +226,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera assert(strlen($finalHash) > 0); // Is the pointer already initialized? - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: finalHash[' . gettype($finalHash) . ']=' . $finalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: finalHash[' . gettype($finalHash) . ']=' . $finalHash); assert(isset($this->chunkPointers[$finalHash])); // Return it @@ -243,7 +243,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera assert(isset($this->chunkPointers[$finalHash])); // Count one up - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: finalHash[' . gettype($finalHash) . ']=' . $finalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: finalHash[' . gettype($finalHash) . ']=' . $finalHash); $this->chunkPointers[$finalHash]++; } @@ -308,7 +308,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera $this->generateHashFromRawData($lastChunk); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: Adding EOP chunk with size of ' . strlen($chunkData) . ',finalHash=' . $finalHash . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: Adding EOP chunk with size of ' . strlen($chunkData) . ',finalHash=' . $finalHash . ' ...'); // Add it as regular chunk $this->addChunkData($finalHash, $chunkData); @@ -329,7 +329,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera // Calculate real (data) chunk size $dataChunkSize = $this->getDataChunkSizeFromHash($finalHash); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: dataChunkSize=' . $dataChunkSize); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: dataChunkSize=' . $dataChunkSize); // Init variables $chunkHash = ''; @@ -345,7 +345,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera } // END - for // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: Raw data of ' . strlen($rawData) . ' bytes has been fragmented into ' . count($this->chunks[$finalHash]) . ' chunk(s).'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: Raw data of ' . strlen($rawData) . ' bytes has been fragmented into ' . count($this->chunks[$finalHash]) . ' chunk(s).'); // Add end-of-package chunk $this->appendEndOfPackageChunk($chunkData, $finalHash); @@ -372,18 +372,18 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera ); // Make sure the chunk is not larger than a TCP package can hold - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: assert: ' . strlen($rawData) . '/' . NetworkPackage::TCP_PACKAGE_SIZE . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: assert: ' . strlen($rawData) . '/' . NetworkPackage::TCP_PACKAGE_SIZE . ' ...'); // @TODO This assert broke packages where the hash chunk was very large: assert(strlen($rawData) <= NetworkPackage::TCP_PACKAGE_SIZE); // Add it to the array if ($prepend === TRUE) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: Prepending ' . strlen($rawData) . ' bytes of a chunk, finalHash=' . $finalHash . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: Prepending ' . strlen($rawData) . ' bytes of a chunk, finalHash=' . $finalHash . ' ...'); array_unshift($this->chunkHashes[$finalHash], $rawDataHash); array_unshift($this->chunks[$finalHash] , $rawData); } else { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: Appending ' . strlen($rawData) . ' bytes of a chunk, finalHash=' . $finalHash . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: Appending ' . strlen($rawData) . ' bytes of a chunk, finalHash=' . $finalHash . ' ...'); // Is the array there? if (!isset($this->chunks[$finalHash])) { @@ -424,14 +424,14 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera assert($this->serialNumber[$finalHash] <= $this->maxSerialNumber); // Encode the current serial number - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: serialNumber[' . $finalHash . ']=' . $this->serialNumber[$finalHash]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: serialNumber[' . $finalHash . ']=' . $this->serialNumber[$finalHash]); $encodedSerialNumber = $this->dec2Hex($this->serialNumber[$finalHash], self::MAX_SERIAL_LENGTH); // Count one up $this->serialNumber[$finalHash]++; // Return the encoded serial number - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: encodedSerialNumber=' . $encodedSerialNumber); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: encodedSerialNumber=' . $encodedSerialNumber); return $encodedSerialNumber; } @@ -476,7 +476,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera } // Return final hash - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: finalHash[' . gettype($finalHash) . ']=' . $finalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: finalHash[' . gettype($finalHash) . ']=' . $finalHash); return $finalHash; } @@ -491,7 +491,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera */ public function getNextRawDataChunk ($finalHash) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: finalHash[' . gettype($finalHash) . ']=' . $finalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER[' . __METHOD__ . ':' . __LINE__ . ']: finalHash[' . gettype($finalHash) . ']=' . $finalHash); try { // Get current chunk index @@ -510,12 +510,12 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera // If there is no entry left, return an empty array if ((!isset($this->chunkHashes[$finalHash][$current])) || (!isset($this->chunks[$finalHash][$current]))) { // No more entries found - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__. ': finalHash=' . $finalHash . ',current=' . $current . ' - No more entries found!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__. ': finalHash=' . $finalHash . ',current=' . $current . ' - No more entries found!'); return array(); } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__. ': finalHash=' . $finalHash . ',current=' . $current . ',chunkHashes()=' . count($this->chunkHashes[$finalHash]) .' - Entry choosen ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__. ': finalHash=' . $finalHash . ',current=' . $current . ',chunkHashes()=' . count($this->chunkHashes[$finalHash]) .' - Entry choosen ...'); // Generate the array $rawDataChunk = array( diff --git a/application/hub/classes/pools/class_BasePool.php b/application/hub/classes/pools/class_BasePool.php index 40f26c4a0..06d02d3eb 100644 --- a/application/hub/classes/pools/class_BasePool.php +++ b/application/hub/classes/pools/class_BasePool.php @@ -84,7 +84,7 @@ class BasePool extends BaseHubSystem implements Visitable { */ protected final function addInstance ($group, $poolName, Visitable $visitableInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: group=' . $group . ',poolName=' . $poolName . ',visitableInstance=' . $visitableInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: group=' . $group . ',poolName=' . $poolName . ',visitableInstance=' . $visitableInstance->__toString() . ' - CALLED!'); // Make sure the group is not 'invalid' assert($group != 'invalid'); @@ -99,7 +99,7 @@ class BasePool extends BaseHubSystem implements Visitable { $this->getPoolEntriesInstance()->addInstance($group, $poolName, $visitableInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -120,7 +120,7 @@ class BasePool extends BaseHubSystem implements Visitable { */ public function accept (Visitor $visitorInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - CALLED!'); // Visit this pool $visitorInstance->visitPool($this); @@ -148,7 +148,7 @@ class BasePool extends BaseHubSystem implements Visitable { // Is this entry visitable? if ($poolEntry instanceof Visitable) { // Visit this entry as well - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-POOL[' . __METHOD__ . ':' . __LINE__ . ']: Going to visit pooled object ' . $poolEntry->__toString() . ' with visitor ' . $visitorInstance->__toString() . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-POOL[' . __METHOD__ . ':' . __LINE__ . ']: Going to visit pooled object ' . $poolEntry->__toString() . ' with visitor ' . $visitorInstance->__toString() . ' ...'); $poolEntry->accept($visitorInstance); } else { // Cannot visit this entry @@ -160,7 +160,7 @@ class BasePool extends BaseHubSystem implements Visitable { } // END - while // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - EXIT!'); } /** diff --git a/application/hub/classes/pools/listener/class_DefaultListenerPool.php b/application/hub/classes/pools/listener/class_DefaultListenerPool.php index 5f9cf6e4c..cd9016fc9 100644 --- a/application/hub/classes/pools/listener/class_DefaultListenerPool.php +++ b/application/hub/classes/pools/listener/class_DefaultListenerPool.php @@ -57,7 +57,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener { parent::addInstance($listenerInstance->getProtocolName(), 'listener', $listenerInstance); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput( + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput( 'POOL[' . __METHOD__ . ':' . __LINE__ . ']: Listener ' . $listenerInstance->__toString() . ' listening to ' . $listenerInstance->getListenAddress() . ':' . $listenerInstance->getListenPort() . ' added to listener pool.' @@ -71,7 +71,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener { */ public function doShutdown () { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down listener pool - CALLED!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down listener pool - CALLED!'); // Get a new visitor $visitorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_listener_pool_visitor_class'); @@ -80,7 +80,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener { $this->accept($visitorInstance); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down listener pool - EXIT!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down listener pool - EXIT!'); } } diff --git a/application/hub/classes/pools/peer/class_DefaultPeerPool.php b/application/hub/classes/pools/peer/class_DefaultPeerPool.php index d4f02dba3..756c3fb16 100644 --- a/application/hub/classes/pools/peer/class_DefaultPeerPool.php +++ b/application/hub/classes/pools/peer/class_DefaultPeerPool.php @@ -94,7 +94,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { */ public function addPeer ($socketResource, $connectionType) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DEFAULT-PEER-POOL[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',connectionType=' . $connectionType . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DEFAULT-PEER-POOL[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',connectionType=' . $connectionType . ' - CALLED!'); // Validate the socket $this->validateSocket($socketResource); @@ -124,11 +124,11 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { } // END - if } else { // Server sockets won't work with socket_getpeername() - self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Socket resource is server socket (' . $socketResource . '). This is not a bug.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Socket resource is server socket (' . $socketResource . '). This is not a bug.'); } // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Adding peer ' . $peerName . ',socketResource=' . $socketResource . ',type=' . $connectionType); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Adding peer ' . $peerName . ',socketResource=' . $socketResource . ',type=' . $connectionType); // Construct the array $socketArray = array( @@ -232,7 +232,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { assert(isset($unlData[UniversalNodeLocator::UNL_PART_PORT])); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Checking ' . count($this->getAllSockets()) . ' socket(s),unlData[' . UniversalNodeLocator::UNL_PART_ADDRESS . ']=' . $unlData[UniversalNodeLocator::UNL_PART_ADDRESS] . ',unlData[' . UniversalNodeLocator::UNL_PART_PORT . ']=' . $unlData[UniversalNodeLocator::UNL_PART_PORT] . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Checking ' . count($this->getAllSockets()) . ' socket(s),unlData[' . UniversalNodeLocator::UNL_PART_ADDRESS . ']=' . $unlData[UniversalNodeLocator::UNL_PART_ADDRESS] . ',unlData[' . UniversalNodeLocator::UNL_PART_PORT . ']=' . $unlData[UniversalNodeLocator::UNL_PART_PORT] . ' ...'); // Default is all sockets $sockets = $this->getAllSockets(); @@ -251,7 +251,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { // Is this a server socket? if ($socketArray[self::SOCKET_ARRAY_RESOURCE] === $this->getListenerInstance()->getSocketResource()) { // Skip 'server' sockets (local socket) - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Skipping server socket ' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: Skipping server socket ' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ' ...'); continue; } // END - if @@ -268,13 +268,13 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { $socketResource = $socketArray[self::SOCKET_ARRAY_RESOURCE]; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: peerIp=' . $peerIp . ' matches with recipient IP address. Taking socket=' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ',type=' . $socketArray[self::SOCKET_ARRAY_CONN_TYPE]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: peerIp=' . $peerIp . ' matches with recipient IP address. Taking socket=' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ',type=' . $socketArray[self::SOCKET_ARRAY_CONN_TYPE]); break; } // END - if } // END - foreach // Return the determined socket resource - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[' . gettype($socketResource) . ']=' . $socketResource); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[' . gettype($socketResource) . ']=' . $socketResource); return $socketResource; } } diff --git a/application/hub/classes/producer/class_BaseProducer.php b/application/hub/classes/producer/class_BaseProducer.php index 16430bd89..647a5cbcf 100644 --- a/application/hub/classes/producer/class_BaseProducer.php +++ b/application/hub/classes/producer/class_BaseProducer.php @@ -136,7 +136,7 @@ abstract class BaseProducer extends BaseFrameworkSystem { $this->initIncomingQueue(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: All queues have been initialized.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: All queues have been initialized.'); } /** diff --git a/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php b/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php index 4850d5e5d..7099f01fa 100644 --- a/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php +++ b/application/hub/classes/producer/cruncher/keys/class_CruncherKeyProducer.php @@ -85,11 +85,11 @@ class CruncherKeyProducer extends BaseKeyProducer implements KeyProducer, Regist // Is this cruncher virgin? if (!$stateInstance->isCruncherStateVirgin()) { // This cruncher is not virgin, so skip it - self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: The cruncher is not virgin. stateInstance=' . $stateInstance->__toString() . ''); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: The cruncher is not virgin. stateInstance=' . $stateInstance->__toString() . ''); return; } elseif (!$this->getIteratorInstance()->valid()) { // This producer's iterator has finished its assignment - self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: Finished creating keys. iteratorInstance=' . $this->getIteratorInstance()->__toString() . ''); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: Finished creating keys. iteratorInstance=' . $this->getIteratorInstance()->__toString() . ''); return; } @@ -114,7 +114,7 @@ class CruncherKeyProducer extends BaseKeyProducer implements KeyProducer, Regist // Is the per-work unit limit reached? if ($this->isOutgoingQueueLimitReached('cruncher_per_unit_key_limit')) { // @TODO Send the produced key bundle to the unit producer's input queue - self::createDebugInstance(__CLASS__)->debugOutput('currentKey(b64)="' . base64_encode($currentKey) . '" needs to be processed.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('currentKey(b64)="' . base64_encode($currentKey) . '" needs to be processed.'); // At last re-init the stack $this->initOutgoingQueue(); diff --git a/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php b/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php index 4014b5f79..38ab0d81b 100644 --- a/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php +++ b/application/hub/classes/producer/cruncher/work_units/class_CruncherTestUnitProducer.php @@ -95,7 +95,7 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer, $encryptedMessage = $this->getHelperInstance()->generateRandomMessage(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: An encrypted, random message has been generated. Generating keys ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PRODUCER: An encrypted, random message has been generated. Generating keys ...'); // Set the encrypted message in the template instance $this->getTemplateInstance()->assignVariable('encrypted_message', $encryptedMessage); diff --git a/application/hub/classes/recipient/dht/class_DhtRecipient.php b/application/hub/classes/recipient/dht/class_DhtRecipient.php index e8f213966..2160cf80a 100644 --- a/application/hub/classes/recipient/dht/class_DhtRecipient.php +++ b/application/hub/classes/recipient/dht/class_DhtRecipient.php @@ -59,7 +59,7 @@ class DhtRecipient extends BaseRecipient implements Recipient { */ public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient . ' - CALLED!'); // Make sure the recipient is valid assert($recipient == NetworkPackage::NETWORK_TARGET_DHT); @@ -81,12 +81,12 @@ class DhtRecipient extends BaseRecipient implements Recipient { $unl = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS]; // Add it to the list - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: Calling listInstance->addEntry(' . $unl . ') ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: Calling listInstance->addEntry(' . $unl . ') ...'); $listInstance->addEntry('unl', $unl); } // END - foreach // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient . ' - EXIT!'); } } diff --git a/application/hub/classes/recipient/direct/class_DirectRecipient.php b/application/hub/classes/recipient/direct/class_DirectRecipient.php index bd29a5a2d..b8395f342 100644 --- a/application/hub/classes/recipient/direct/class_DirectRecipient.php +++ b/application/hub/classes/recipient/direct/class_DirectRecipient.php @@ -63,7 +63,7 @@ class DirectRecipient extends BaseRecipient implements Recipient { */ public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DIRECT-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient); // "Explode" all recipients $recipients = explode(NetworkPackage::PACKAGE_RECIPIENT_SEPARATOR, $recipient); diff --git a/application/hub/classes/recipient/self/class_SelfRecipient.php b/application/hub/classes/recipient/self/class_SelfRecipient.php index 2af6d5769..21b047388 100644 --- a/application/hub/classes/recipient/self/class_SelfRecipient.php +++ b/application/hub/classes/recipient/self/class_SelfRecipient.php @@ -63,7 +63,7 @@ class SelfRecipient extends BaseRecipient implements Recipient { */ public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) { // Make sure the recipient is valid - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SELF-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SELF-RECIPIENT[' . __METHOD__ . ':' . __LINE__ . ']: recipient=' . $recipient); // @TODO Add more checks on data assert($recipient == NetworkPackage::NETWORK_TARGET_SELF); diff --git a/application/hub/classes/recipient/upper/class_UpperRecipient.php b/application/hub/classes/recipient/upper/class_UpperRecipient.php index 04daf637c..483f73853 100644 --- a/application/hub/classes/recipient/upper/class_UpperRecipient.php +++ b/application/hub/classes/recipient/upper/class_UpperRecipient.php @@ -63,7 +63,7 @@ class UpperRecipient extends BaseRecipient implements Recipient { */ public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) { // Make sure the recipient is valid - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('UPPER-RECIPIENT: recipient=' . $recipient); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UPPER-RECIPIENT: recipient=' . $recipient); assert($recipient == NetworkPackage::NETWORK_TARGET_UPPER); // Get all bootstrap nodes @@ -71,14 +71,14 @@ class UpperRecipient extends BaseRecipient implements Recipient { // Is maximum reached? if ($listInstance->count() == $this->getConfigInstance()->getConfigEntry('package_recipient_max_count')) { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-RESOLVER[' . __METHOD__ . ':' . __LINE__ . ']: Going to abort at maximum of ' . $this->getConfigInstance()->getConfigEntry('package_recipient_max_count') . ' recipients!'); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RECIPIENT-RESOLVER[' . __METHOD__ . ':' . __LINE__ . ']: Going to abort at maximum of ' . $this->getConfigInstance()->getConfigEntry('package_recipient_max_count') . ' recipients!'); // Then stop adding more break; } // END - if // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-RESOLVER[' . __METHOD__ . ':' . __LINE__ . ']: Adding node ' . print_r($unlData, TRUE) . ' as recipient.'); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RECIPIENT-RESOLVER[' . __METHOD__ . ':' . __LINE__ . ']: Adding node ' . print_r($unlData, TRUE) . ' as recipient.'); // Add the entry $listInstance->addEntry('unl', $unlData); diff --git a/application/hub/classes/registry/socket/class_SocketRegistry.php b/application/hub/classes/registry/socket/class_SocketRegistry.php index a420ecaa5..fc138573d 100644 --- a/application/hub/classes/registry/socket/class_SocketRegistry.php +++ b/application/hub/classes/registry/socket/class_SocketRegistry.php @@ -65,14 +65,14 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke */ private function getSubRegistryKey (ShareableInfo $infoInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: infoInstance=' . $infoInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: infoInstance=' . $infoInstance->__toString() . ' - CALLED!'); // Get address and port $address = $infoInstance->getAddress(); $port = $infoInstance->getPort(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: address=' . $address . ',port=' . $port); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: address=' . $address . ',port=' . $port); // Get connection type and port number and add both together $key = sprintf('%s:%s:%s:%s', @@ -83,7 +83,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke ); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ' - EXIT!'); // Return resulting key return $key; @@ -97,13 +97,13 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke */ private function getRegistryKeyFromInfo (ShareableInfo $infoInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',infoInstance=' . $infoInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',infoInstance=' . $infoInstance->__toString() . ' - CALLED!'); // Get the key $key = $infoInstance->getProtocolName(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ' - EXIT!'); // Return resulting key return $key; @@ -117,7 +117,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke */ private function isInfoRegistered (ShareableInfo $infoInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ' - CALLED!'); // Get the key $key = $this->getRegistryKeyFromInfo($infoInstance); @@ -126,7 +126,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $isRegistered = $this->instanceExists($key); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ',isRegistered=' . intval($isRegistered) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ',isRegistered=' . intval($isRegistered) . ' - EXIT!'); // Return result return $isRegistered; @@ -142,7 +142,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke */ public function isSocketRegistered (ShareableInfo $infoInstance, $socketResource) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - CALLED!'); // Default is not registered $isRegistered = FALSE; @@ -153,7 +153,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $key = $this->getRegistryKeyFromInfo($infoInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ' - Trying to get instance ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ' - Trying to get instance ...'); // Get the registry $registryInstance = $this->getInstance($key); @@ -162,12 +162,12 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $socketKey = $this->getSubRegistryKey($infoInstance); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...'); // Is it there? if ($registryInstance->instanceExists($socketKey)) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey)); // Get the instance $registeredInstance = $registryInstance->getInstance($socketKey); @@ -176,12 +176,12 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $isRegistered = (($registeredInstance instanceof SocketContainer) && ($registeredInstance->ifSocketResourceMatches($socketResource))); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Final result: isRegistered(' . $socketResource . ')=' . intval($isRegistered)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Final result: isRegistered(' . $socketResource . ')=' . intval($isRegistered)); } // END - if } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',isRegistered=' . intval($isRegistered) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',isRegistered=' . intval($isRegistered) . ' - EXIT!'); // Return the result return $isRegistered; @@ -198,7 +198,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke */ public function registerSocket (ShareableInfo $infoInstance, $socketResource, array $packageData = array()) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:info=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - CALLED!'); // Is the socket already registered? if ($this->isSocketRegistered($infoInstance, $socketResource)) { @@ -225,7 +225,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $socketInstance = ObjectFactory::CreateObjectByConfiguredName('socket_container_class', array($socketResource, $infoInstance, $packageData)); // We have a sub-registry, the socket key and the socket, now we need to put all together - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: socketKey=' . $socketKey . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - adding socket container instance ...'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: socketKey=' . $socketKey . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - adding socket container instance ...'); $registryInstance->addInstance($socketKey, $socketInstance); } @@ -238,7 +238,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke */ public function getRegisteredSocketResource (Listenable $listenerInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ' - CALLED!'); // The socket must be registered before we can return it if (!$this->isInfoRegistered($listenerInstance)) { @@ -259,7 +259,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $socketResource = $registryInstance->getInstance($socketKey)->getSocketResource(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']:listener=' . $listenerInstance->getConnectionType() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - EXIT!'); // Return the resource return $socketResource; @@ -279,12 +279,12 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke // Get all keys and check them foreach ($this->getInstanceRegistry() as $key => $registryInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',registryInstance=' . $registryInstance->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',registryInstance=' . $registryInstance->__toString()); // This is always a SubRegistry instance foreach ($registryInstance->getInstanceRegistry() as $subKey => $containerInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',subKey=' . $subKey . ',containerInstance=' . $containerInstance->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',subKey=' . $subKey . ',containerInstance=' . $containerInstance->__toString()); // Is this a SocketContainer instance and is the address the same? if (($containerInstance instanceof SocketContainer) && ($containerInstance->ifAddressMatches($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]))) { @@ -296,7 +296,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $helperInstance = $containerInstance->getHelperInstance(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',subKey=' . $subKey . ',listenerInstance[]=' . gettype($listenerInstance) . ',helperInstance[]=' . gettype($helperInstance)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',subKey=' . $subKey . ',listenerInstance[]=' . gettype($listenerInstance) . ',helperInstance[]=' . gettype($helperInstance)); // Is a listener or helper set? if ($listenerInstance instanceof Listenable) { @@ -317,7 +317,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',subKey=' . $subKey . ',infoInstance[' . gettype($infoInstance) . ']=' . $infoInstance->__toString() . ' with protocol ' . $infoInstance->getProtocolName() . ' - FOUND!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',subKey=' . $subKey . ',infoInstance[' . gettype($infoInstance) . ']=' . $infoInstance->__toString() . ' with protocol ' . $infoInstance->getProtocolName() . ' - FOUND!'); break; } // END - if } // END - foreach diff --git a/application/hub/classes/source/class_BaseUrlSource.php b/application/hub/classes/source/class_BaseUrlSource.php index c4ef08404..ba788c18b 100644 --- a/application/hub/classes/source/class_BaseUrlSource.php +++ b/application/hub/classes/source/class_BaseUrlSource.php @@ -82,7 +82,7 @@ class BaseUrlSource extends BaseSource { */ protected function enrichCrawlerQueueData (array &$crawlData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: crawlData()=' . count($crawlData) . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: crawlData()=' . count($crawlData) . ' - CALLED!'); // Check for minimum array elements assert(isset($crawlData[self::CRAWL_JOB_ARRAY_START_URL])); @@ -91,7 +91,7 @@ class BaseUrlSource extends BaseSource { // @TODO Add more elements // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -102,13 +102,13 @@ class BaseUrlSource extends BaseSource { */ protected function enqueueInFileStack (array $crawlData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: crawlData()=' . count($crawlData) . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: crawlData()=' . count($crawlData) . ' - CALLED!'); // Get the stack instance and enqueue it $this->getStackInstance()->pushNamed(self::STACKER_NAME_URLS, $crawlData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } } diff --git a/application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php b/application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php index 33caffaf8..c6cfc318f 100644 --- a/application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php +++ b/application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php @@ -101,7 +101,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R * @return $isFound Whether a CSV file is found */ private function isCsvFileFound () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Is it valid? if (!$this->getDirectoryInstance()->getDirectoryIteratorInstance()->valid()) { @@ -110,16 +110,16 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R } // END - if // Read next entry - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: this->csvFileImported=' . print_r($this->csvFileImported, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: this->csvFileImported=' . print_r($this->csvFileImported, TRUE)); $directoryEntry = $this->getDirectoryInstance()->readDirectoryExcept(array_merge(array('.htaccess', '.', '..'), $this->csvFileImported)); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE[' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE[' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry); // Is it empty or wrong file extension? if ((empty($directoryEntry)) || (substr($directoryEntry, -4, 4) != '.csv')) { // Skip further processing - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE[' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - SKIPPED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE[' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - SKIPPED!'); return FALSE; } // END - if @@ -127,7 +127,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R $this->lastCsvFileInstance = ObjectFactory::createObjectByConfiguredName('csv_input_file_class', array($this->csvFilePath . '/' . $directoryEntry)); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - Instance created - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - Instance created - EXIT!'); // Found an entry return TRUE; @@ -159,7 +159,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R */ private function saveCsvDataInCrawlerQueue (array $csvData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvData()=' . count($csvData) . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvData()=' . count($csvData) . ' - CALLED!'); // The array must have a fixed amount of elements, later enhancements may accept more assert(count($csvData) == self::CRAWL_ENTRY_SIZE); @@ -176,13 +176,13 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R ); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvArray()=' . count($csvArray) . ' - BEFORE!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvArray()=' . count($csvArray) . ' - BEFORE!'); // Then add more data to it $this->enrichCrawlerQueueData($csvArray); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvArray()=' . count($csvArray) . ' - AFTER!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvArray()=' . count($csvArray) . ' - AFTER!'); /* * Then enqueue it in the file stack. The local crawler "task" will @@ -191,7 +191,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R $this->enqueueInFileStack($csvArray); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -227,7 +227,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R * @throws NullPointerException If lastCsvFileInstance is not set */ private function addCsvFile () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Is the instance set? if (is_null($this->lastCsvFileInstance)) { @@ -244,7 +244,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R // ... and finally NULL it (to save some RAM) $this->lastCsvFileInstance = NULL; - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -256,7 +256,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R */ private function parseCsvFile () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Get next entry $csvFileInstance = $this->getStackSourceInstance()->popNamed(self::STACK_NAME_CSV_FILE); @@ -265,7 +265,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R $csvData = $csvFileInstance->readCsvFileLine($this->columnSeparator); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE)); // Expect always an array assert(is_array($csvData)); @@ -273,7 +273,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R // Is the array empty? if (count($csvData) == 0) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: File ' . $csvFileInstance->getFileName() . ' has been fully read.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: File ' . $csvFileInstance->getFileName() . ' has been fully read.'); // Try to close it by actually unsetting (destructing) it unset($csvFileInstance); @@ -295,7 +295,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R $this->getStackSourceInstance()->pushNamed(self::STACK_NAME_CSV_ENTRY, $csvData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** @@ -305,13 +305,13 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R */ private function parseCsvEntry () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Pop it from stack $csvData = $this->getStackSourceInstance()->popNamed(self::STACK_NAME_CSV_ENTRY); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE)); // It must have a fixed amount of elements (see method parseCsvFile() for details) assert(count($csvData) == self::CRAWL_ENTRY_SIZE); @@ -320,7 +320,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R $this->saveCsvDataInCrawlerQueue($csvData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!'); } /** diff --git a/application/hub/classes/states/dht/active/class_DhtActiveState.php b/application/hub/classes/states/dht/active/class_DhtActiveState.php index 549f0fd03..fded634ca 100644 --- a/application/hub/classes/states/dht/active/class_DhtActiveState.php +++ b/application/hub/classes/states/dht/active/class_DhtActiveState.php @@ -46,7 +46,7 @@ class DhtActiveState extends BaseDhtState implements Stateable { $stateInstance = new DhtActiveState(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-STATE[' . __METHOD__ . ':' . __LINE__ . ']: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-STATE[' . __METHOD__ . ':' . __LINE__ . ']: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Set the dht instance $stateInstance->setDhtInstance($dhtInstance); diff --git a/application/hub/classes/states/dht/booting/class_DhtBootingState.php b/application/hub/classes/states/dht/booting/class_DhtBootingState.php index f6f05cdc5..55e991374 100644 --- a/application/hub/classes/states/dht/booting/class_DhtBootingState.php +++ b/application/hub/classes/states/dht/booting/class_DhtBootingState.php @@ -46,7 +46,7 @@ class DhtBootingState extends BaseDhtState implements Stateable { $stateInstance = new DhtBootingState(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-STATE[' . __METHOD__ . ':' . __LINE__ . ']: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-STATE[' . __METHOD__ . ':' . __LINE__ . ']: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Set the dht instance $stateInstance->setDhtInstance($dhtInstance); diff --git a/application/hub/classes/states/dht/init/class_DhtInitState.php b/application/hub/classes/states/dht/init/class_DhtInitState.php index 25e6a8262..4a6ac153b 100644 --- a/application/hub/classes/states/dht/init/class_DhtInitState.php +++ b/application/hub/classes/states/dht/init/class_DhtInitState.php @@ -46,7 +46,7 @@ class DhtInitState extends BaseDhtState implements Stateable { $stateInstance = new DhtInitState(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-STATE[' . __METHOD__ . ':' . __LINE__ . ']: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-STATE[' . __METHOD__ . ':' . __LINE__ . ']: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Set the dht instance $stateInstance->setDhtInstance($dhtInstance); diff --git a/application/hub/classes/states/dht/virgin/class_DhtVirginState.php b/application/hub/classes/states/dht/virgin/class_DhtVirginState.php index e9998fa4a..2d3da3ca6 100644 --- a/application/hub/classes/states/dht/virgin/class_DhtVirginState.php +++ b/application/hub/classes/states/dht/virgin/class_DhtVirginState.php @@ -46,7 +46,7 @@ class DhtVirginState extends BaseDhtState implements Stateable { $stateInstance = new DhtVirginState(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-STATE[' . __METHOD__ . ':' . __LINE__ . ']: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-STATE[' . __METHOD__ . ':' . __LINE__ . ']: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Set the dht instance $stateInstance->setDhtInstance($dhtInstance); diff --git a/application/hub/classes/states/miner/booting/class_MinerBootingState.php b/application/hub/classes/states/miner/booting/class_MinerBootingState.php index a30e8a641..8886af185 100644 --- a/application/hub/classes/states/miner/booting/class_MinerBootingState.php +++ b/application/hub/classes/states/miner/booting/class_MinerBootingState.php @@ -50,7 +50,7 @@ class MinerBootingState extends BaseMinerState implements Stateable { $stateInstance = new MinerBootingState(); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE: Has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MINER-STATE: Has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.'); // Return the prepared instance return $stateInstance; @@ -70,7 +70,7 @@ class MinerBootingState extends BaseMinerState implements Stateable { } // END - if // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE: Calling prepareBlockProduction() on ' . $executorInstance->__toString() . ' ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MINER-STATE: Calling prepareBlockProduction() on ' . $executorInstance->__toString() . ' ...'); // Now prepare the unit production to maybe become 'virgin' or 'active' if work/test units are there $executorInstance->prepareBlockProduction($this); diff --git a/application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php b/application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php index 8299f0f5d..14b17a392 100644 --- a/application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php +++ b/application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php @@ -64,7 +64,7 @@ class ConnectionStatisticsHelper extends BaseHubSystem { * @return $isExhausted Whether the retry count has been reached */ public static function isConnectRetryExhausted (ConnectionHelper $helperInstance) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - CALLED!'); // Construct config entry $configEntry = $helperInstance->getProtocolName() . '_connect_retry_max'; @@ -78,7 +78,7 @@ class ConnectionStatisticsHelper extends BaseHubSystem { ); // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ',isExhausted=' . intval($isExhausted) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ',isExhausted=' . intval($isExhausted) . ' - EXIT!'); return $isExhausted; } @@ -89,15 +89,15 @@ class ConnectionStatisticsHelper extends BaseHubSystem { * @return void */ public static function increaseConnectRetry (ConnectionHelper $helperInstance) { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - CALLED!'); // Is the counter there if (!isset(self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'])) { // First attempt - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - FIRST!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - FIRST!'); self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'] = 1; } else { // Next attempt - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - INCREMENT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-STATISTICS[' . __METHOD__ . ':' . __LINE__ . ']: helperInstance=' . $helperInstance->__toString() . ' - INCREMENT!'); self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count']++; } diff --git a/application/hub/classes/streams/raw_data/input/class_RawDataInputStream.php b/application/hub/classes/streams/raw_data/input/class_RawDataInputStream.php index 8ac84ef2d..04995b08b 100644 --- a/application/hub/classes/streams/raw_data/input/class_RawDataInputStream.php +++ b/application/hub/classes/streams/raw_data/input/class_RawDataInputStream.php @@ -68,7 +68,7 @@ class RawDataInputStream extends BaseStream implements InputStream { */ public function streamData ($data) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RAW-INPUT-STREAM[' . __METHOD__ . ':' . __LINE__ . ': data(' . strlen($data) . ')=' . $data); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-INPUT-STREAM[' . __METHOD__ . ':' . __LINE__ . ': data(' . strlen($data) . ')=' . $data); // Do we have start and end marker again? assert($this->ifStartEndMarkersSet($data)); @@ -98,7 +98,7 @@ class RawDataInputStream extends BaseStream implements InputStream { } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RAW-INPUT-STREAM: Length of data is now ' . strlen($data) . ' Bytes.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-INPUT-STREAM: Length of data is now ' . strlen($data) . ' Bytes.'); // Return it return $data; diff --git a/application/hub/classes/streams/raw_data/output/class_RawDataOutputStream.php b/application/hub/classes/streams/raw_data/output/class_RawDataOutputStream.php index 97ce0ae21..e381b34d7 100644 --- a/application/hub/classes/streams/raw_data/output/class_RawDataOutputStream.php +++ b/application/hub/classes/streams/raw_data/output/class_RawDataOutputStream.php @@ -58,9 +58,9 @@ class RawDataOutputStream extends BaseStream implements OutputStream { * [[S]] - Start marker * [[E]] - End marker */ - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RAW-OUTPUT-STREAM[' . __METHOD__ . ':' . __LINE__ . ']: data()=' . strlen($data) . ' - BEFORE!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-OUTPUT-STREAM[' . __METHOD__ . ':' . __LINE__ . ']: data()=' . strlen($data) . ' - BEFORE!'); $data = BaseRawDataHandler::STREAM_START_MARKER . base64_encode($data) . BaseRawDataHandler::STREAM_END_MARKER; - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RAW-OUTPUT-STREAM[' . __METHOD__ . ':' . __LINE__ . ']: data(' . strlen($data) . ')=' . $data); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-OUTPUT-STREAM[' . __METHOD__ . ':' . __LINE__ . ']: data(' . strlen($data) . ')=' . $data); // Return it return $data; diff --git a/application/hub/classes/tags/package/class_PackageTags.php b/application/hub/classes/tags/package/class_PackageTags.php index 1d74bd7f9..855b240b0 100644 --- a/application/hub/classes/tags/package/class_PackageTags.php +++ b/application/hub/classes/tags/package/class_PackageTags.php @@ -69,7 +69,7 @@ class PackageTags extends BaseTag implements Tagable { */ private function initObjectRegistry () { // Output debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: Initializing object registry - CALLED!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: Initializing object registry - CALLED!'); // Get the application instance $applicationInstance = Registry::getRegistry()->getInstance('app'); @@ -87,7 +87,7 @@ class PackageTags extends BaseTag implements Tagable { $this->getTemplateInstance()->renderXmlContent(); // Output debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: Initializing object registry - EXIT!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: Initializing object registry - EXIT!'); } /** @@ -98,7 +98,7 @@ class PackageTags extends BaseTag implements Tagable { */ private function extractTagsFromPackageData (array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: packageData=' . print_r($packageData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: packageData=' . print_r($packageData, TRUE)); /* * We take a look at the tags (in most cases only one is needed) so @@ -127,7 +127,7 @@ class PackageTags extends BaseTag implements Tagable { // "Walk" over all tags foreach ($this->getTags() as $tag) { // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: Validating tag ' . $tag . ' ...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: Validating tag ' . $tag . ' ...'); // Get an array from this tag $entry = $objectRegistryInstance->getArrayFromKey(XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_NAME, $tag); diff --git a/application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php b/application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php index 8b9b3f5dd..e2fc309eb 100644 --- a/application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php +++ b/application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php @@ -73,7 +73,7 @@ class AptProxyListenerTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php b/application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php index 81e19043e..551c15dbd 100644 --- a/application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php +++ b/application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php @@ -73,7 +73,7 @@ class ChatTelnetListenerTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php b/application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php index 3befcd344..587f11226 100644 --- a/application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php +++ b/application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php @@ -70,7 +70,7 @@ class CrawlerNodeCommunicatorTask extends BaseTask implements Taskable, Visitabl $stateInstance = Registry::getRegistry()->getInstance('crawler')->getStateInstance(); // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); // We can now invoke that state instance and pass our communicator instance for generating some test units $stateInstance->executeState($communicatorInstance); @@ -83,7 +83,7 @@ class CrawlerNodeCommunicatorTask extends BaseTask implements Taskable, Visitabl * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php b/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php index 2091ecc4e..2e2a90302 100644 --- a/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php +++ b/application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php @@ -74,7 +74,7 @@ class CrawlerDocumentParserTask extends BaseTask implements Taskable, Visitable * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php b/application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php index 976835caf..9f808b818 100644 --- a/application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php +++ b/application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php @@ -74,7 +74,7 @@ class CrawlerMimeSnifferTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php b/application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php index 879bb94c6..a58e93a04 100644 --- a/application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php +++ b/application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php @@ -74,7 +74,7 @@ class CrawlerPingTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php b/application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php index 73c5830d6..2bb9098e0 100644 --- a/application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php +++ b/application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php @@ -74,7 +74,7 @@ class CrawlerRemoteJobPublisherTask extends BaseTask implements Taskable, Visita * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/scanner/uploaded_list/class_CrawlerUploadedListScannerTask.php b/application/hub/classes/tasks/crawler/scanner/uploaded_list/class_CrawlerUploadedListScannerTask.php index 14bde83b3..773838b37 100644 --- a/application/hub/classes/tasks/crawler/scanner/uploaded_list/class_CrawlerUploadedListScannerTask.php +++ b/application/hub/classes/tasks/crawler/scanner/uploaded_list/class_CrawlerUploadedListScannerTask.php @@ -74,7 +74,7 @@ class CrawlerUploadedListScannerTask extends BaseTask implements Taskable, Visit * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php b/application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php index e884207b9..3ad17ab36 100644 --- a/application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php +++ b/application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php @@ -74,7 +74,7 @@ class CrawlerSnippetExtractorTask extends BaseTask implements Taskable, Visitabl * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php b/application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php index 70215e802..25f81a757 100644 --- a/application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php +++ b/application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php @@ -74,7 +74,7 @@ class CrawlerStructureAnalyzerTask extends BaseTask implements Taskable, Visitab * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php b/application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php index df4828a06..38a9b7c22 100644 --- a/application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php +++ b/application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php @@ -74,7 +74,7 @@ class CrawlerLocalUrlCrawlerTask extends BaseTask implements Taskable, Visitable * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php b/application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php index 6eebf1045..93b5f7e18 100644 --- a/application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php +++ b/application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php @@ -74,7 +74,7 @@ class CrawlerRemoteUrlCrawlerTask extends BaseTask implements Taskable, Visitabl * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceFoundRssTask.php b/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceFoundRssTask.php index 6059c56f5..c4ca6216d 100644 --- a/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceFoundRssTask.php +++ b/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceFoundRssTask.php @@ -86,7 +86,7 @@ class CrawlerUrlSourceFoundRssTask extends BaseUrlSourceTask implements Taskable * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceLocalStartTask.php b/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceLocalStartTask.php index 04131e44d..0a8b795cd 100644 --- a/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceLocalStartTask.php +++ b/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceLocalStartTask.php @@ -86,7 +86,7 @@ class CrawlerUrlSourceLocalStartTask extends BaseUrlSourceTask implements Taskab * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceRssStartTask.php b/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceRssStartTask.php index 5626afd80..7493c245a 100644 --- a/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceRssStartTask.php +++ b/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceRssStartTask.php @@ -86,7 +86,7 @@ class CrawlerUrlSourceRssStartTask extends BaseUrlSourceTask implements Taskable * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceUploadedListTask.php b/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceUploadedListTask.php index 0b6b89176..0be30a248 100644 --- a/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceUploadedListTask.php +++ b/application/hub/classes/tasks/crawler/url_source/class_CrawlerUrlSourceUploadedListTask.php @@ -86,7 +86,7 @@ class CrawlerUrlSourceUploadedListTask extends BaseUrlSourceTask implements Task * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php b/application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php index a19428218..5c442fa1e 100644 --- a/application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php +++ b/application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php @@ -69,7 +69,7 @@ class CruncherKeyProducerTask extends BaseTask implements Taskable, Visitable { $stateInstance = Registry::getRegistry()->getInstance('cruncher')->getStateInstance(); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); // We can now invoke that state instance and pass our producer instance for generating some test units $stateInstance->executeState($producerInstance); @@ -82,7 +82,7 @@ class CruncherKeyProducerTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php b/application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php index dc5aeb72c..8a15bb9a5 100644 --- a/application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php +++ b/application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php @@ -69,7 +69,7 @@ class CruncherTestUnitProducerTask extends BaseTask implements Taskable, Visitab $stateInstance = Registry::getRegistry()->getInstance('cruncher')->getStateInstance(); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); // We can now invoke that state instance and pass our producer instance for generating some test units $stateInstance->executeState($producerInstance); @@ -82,7 +82,7 @@ class CruncherTestUnitProducerTask extends BaseTask implements Taskable, Visitab * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php b/application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php index 87068b0b2..aa995243b 100644 --- a/application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php +++ b/application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php @@ -82,7 +82,7 @@ class CruncherWorkUnitFetcherTask extends BaseTask implements Taskable, Visitabl * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php b/application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php index 22de1ae89..74dcd0ef0 100644 --- a/application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php +++ b/application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php @@ -82,7 +82,7 @@ class MinerBlockFetcherTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php b/application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php index 7ca28a3ac..f726aa93e 100644 --- a/application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php +++ b/application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php @@ -69,7 +69,7 @@ class MinerRealGenesisBlockProducerTask extends BaseTask implements Taskable, Vi $stateInstance = Registry::getRegistry()->getInstance('miner')->getStateInstance(); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); // We can now invoke that state instance and pass our producer instance for generating some test units $stateInstance->executeState($producerInstance); @@ -82,7 +82,7 @@ class MinerRealGenesisBlockProducerTask extends BaseTask implements Taskable, Vi * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php b/application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php index 0cdda15dc..a1ef811c3 100644 --- a/application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php +++ b/application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php @@ -69,7 +69,7 @@ class MinerTestGenesisBlockProducerTask extends BaseTask implements Taskable, Vi $stateInstance = Registry::getRegistry()->getInstance('miner')->getStateInstance(); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); // We can now invoke that state instance and pass our producer instance for generating some test units $stateInstance->executeState($producerInstance); @@ -82,7 +82,7 @@ class MinerTestGenesisBlockProducerTask extends BaseTask implements Taskable, Vi * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php b/application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php index 5f87718a2..6500e2ba3 100644 --- a/application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php +++ b/application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php @@ -70,7 +70,7 @@ class MinerNodeCommunicatorTask extends BaseTask implements Taskable, Visitable $stateInstance = $communicatorInstance->getStateInstance(); // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); + /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Executing stateInstance=' . $stateInstance->__toString()); // We can now invoke that state instance and pass our communicator instance for generating some test units $stateInstance->executeState($communicatorInstance); @@ -83,7 +83,7 @@ class MinerNodeCommunicatorTask extends BaseTask implements Taskable, Visitable * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php b/application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php index 1cbbb8f93..7b8f097d5 100644 --- a/application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php +++ b/application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php @@ -111,7 +111,7 @@ class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php b/application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php index 3f24ec0f6..5a436002a 100644 --- a/application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php +++ b/application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php @@ -89,7 +89,7 @@ class NetworkPackageWriterTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php b/application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php index 6ca0a0a71..e7ee04ac7 100644 --- a/application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php +++ b/application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php @@ -73,7 +73,7 @@ class NodeAnnouncementTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php b/application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php index da9edb417..7a0fadea4 100644 --- a/application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php +++ b/application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php @@ -108,7 +108,7 @@ class NodeChunkAssemblerTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php b/application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php index f12b2205e..5a2bcaf46 100644 --- a/application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php +++ b/application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php @@ -82,7 +82,7 @@ class NodePackageDecoderTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php index a794cafa7..acbd89bdc 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php @@ -79,7 +79,7 @@ class NodeDhtBootstrapTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php index 6485392f7..2c0815723 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php @@ -79,7 +79,7 @@ class NodeDhtInitializationTask extends BaseTask implements Taskable, Visitable * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php index 367a3d813..965fe9f0e 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php @@ -79,7 +79,7 @@ class NodeDhtLateBootstrapTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php index 48da0743c..2b281e5b0 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php @@ -86,7 +86,7 @@ class NodeDhtPublicationCheckTask extends BaseTask implements Taskable, Visitabl * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php index 813e4e2ad..b31d65c48 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php @@ -86,7 +86,7 @@ class NodeDhtPublicationTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php b/application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php index 503f0474d..0eb9755ba 100644 --- a/application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php +++ b/application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php @@ -86,7 +86,7 @@ class NodeDhtQueryTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php b/application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php index 6bf9901eb..8ef264635 100644 --- a/application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php +++ b/application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php @@ -56,7 +56,7 @@ class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable { $nodeInstance = NodeObjectFactory::createNodeInstance(); // Visit the pool listener task - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('LISTENER-TASK[' . __METHOD__ . ':' . __LINE__ . ']: Going to visit object ' . $nodeInstance->getListenerPoolInstance()->__toString() . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-TASK[' . __METHOD__ . ':' . __LINE__ . ']: Going to visit object ' . $nodeInstance->getListenerPoolInstance()->__toString() . ' ...'); $nodeInstance->getListenerPoolInstance()->accept($visitorInstance); // Visit this task @@ -80,7 +80,7 @@ class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/ping/class_NodePingTask.php b/application/hub/classes/tasks/node/ping/class_NodePingTask.php index 4457e98d1..58eda224f 100644 --- a/application/hub/classes/tasks/node/ping/class_NodePingTask.php +++ b/application/hub/classes/tasks/node/ping/class_NodePingTask.php @@ -84,7 +84,7 @@ class NodePingTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php b/application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php index 8a7d99fb1..924bf3cdc 100644 --- a/application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php +++ b/application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php @@ -73,7 +73,7 @@ class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php b/application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php index e183bedd3..e54d3afab 100644 --- a/application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php +++ b/application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php @@ -74,7 +74,7 @@ class NodePackageTagsInitTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php b/application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php index 49eeef88f..d5d2a2166 100644 --- a/application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php +++ b/application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php @@ -73,7 +73,7 @@ class NodeUpdateCheckTask extends BaseTask implements Taskable, Visitable { * @todo 0% done */ public function doShutdown () { - self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } diff --git a/application/hub/classes/template/objects/class_XmlObjectRegistryTemplateEngine.php b/application/hub/classes/template/objects/class_XmlObjectRegistryTemplateEngine.php index 2ca364a20..e2bba47af 100644 --- a/application/hub/classes/template/objects/class_XmlObjectRegistryTemplateEngine.php +++ b/application/hub/classes/template/objects/class_XmlObjectRegistryTemplateEngine.php @@ -105,7 +105,7 @@ class XmlObjectRegistryTemplateEngine extends BaseXmlTemplateEngine implements C // Is the node name self::OBJECT_TYPE_DATA_NAME? if ($nodeName == self::OBJECT_TYPE_DATA_NAME) { // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: Adding object type ' . $characters . ' to registry.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS[' . __METHOD__ . ':' . __LINE__ . ']: Adding object type ' . $characters . ' to registry.'); } // END - if // Add it to the registry diff --git a/application/hub/classes/tools/class_HubTools.php b/application/hub/classes/tools/class_HubTools.php index 211373421..3bf7b135c 100644 --- a/application/hub/classes/tools/class_HubTools.php +++ b/application/hub/classes/tools/class_HubTools.php @@ -142,7 +142,7 @@ class HubTools extends BaseHubSystem { $nodeData = $selfInstance->getDhtInstance()->findNodeLocalBySessionId($sessionId); // Make sure the node id is there - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: sessionId=' . $sessionId . ', nodeData[' . gettype($nodeData) . ']=' . print_r($nodeData, TRUE)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: sessionId=' . $sessionId . ', nodeData[' . gettype($nodeData) . ']=' . print_r($nodeData, TRUE)); assert(isset($nodeData[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_NODE_ID])); // Return it @@ -187,25 +187,25 @@ class HubTools extends BaseHubSystem { if (preg_match('/([a-z0-9]{3,10})\/\/:([a-z0-9\.]{5,})/', $address)) { // @TODO ((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])):([0-9]{3,5}) // Direct Universal Node Locator found - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Direct Universal Node Locator ' . $address . ' detected.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Direct Universal Node Locator ' . $address . ' detected.'); } elseif (isset($selfInstance->sessionIdCache[$address])) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Using entry from sessionIdCache[] array.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Using entry from sessionIdCache[] array.'); // Found in cache! $recipient = $selfInstance->sessionIdCache[$address]; // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: sessionIdCache[' . $address . ']=' . $recipient); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: sessionIdCache[' . $address . ']=' . $recipient); } elseif (preg_match('/([a-f0-9]{' . $selfInstance->getSessionIdLength() . '})/', $address)) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Using internal session id resolver.'); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Using internal session id resolver.'); // Resolve session id into an instance of a LocateableNode class $recipient = $selfInstance->resolveUniversalNodeLocatorBySessionId($address); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Session id ' . $address . ' resolved to ' . $recipient); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Session id ' . $address . ' resolved to ' . $recipient); } else { // Invalid session id/UNL throw new InvalidSessionIdException($address, self::EXCEPTION_SESSION_ID_IS_INVALID); @@ -241,31 +241,31 @@ class HubTools extends BaseHubSystem { */ public static function determineOwnInternalAddress () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Is the internal_address config entry set? if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('allow_publish_internal_address') == 'N') { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Calling self::determineOwnExternalAddress() as allow_publish_internal_address=N is set ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Calling self::determineOwnExternalAddress() as allow_publish_internal_address=N is set ...'); // Not allowed to publish internal address, so use external $unl = self::determineOwnExternalAddress(); } elseif (FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_address') != '') { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Getting config entry internal_address ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Getting config entry internal_address ...'); // Use it as internal address $unl = FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_address'); } else { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Calling self::determineInternalUniversalNodeLocator() ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Calling self::determineInternalUniversalNodeLocator() ...'); // Determine own internal address $unl = self::determineInternalUniversalNodeLocator(); } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ' - EXIT!'); // Return it return $unl; @@ -278,7 +278,7 @@ class HubTools extends BaseHubSystem { */ public static function determineInternalUniversalNodeLocator () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Is there cache? (This shortens a lot calls) if (!isset($GLOBALS[__METHOD__])) { @@ -295,7 +295,7 @@ class HubTools extends BaseHubSystem { } // END - if // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $GLOBALS[__METHOD__] . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $GLOBALS[__METHOD__] . ' - EXIT!'); return $GLOBALS[__METHOD__]; } @@ -306,7 +306,7 @@ class HubTools extends BaseHubSystem { */ public static function determineExternalUniversalNodeLocator () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: CALLED!'); // Is there cache? (This shortens a lot calls) if (!isset($GLOBALS[__METHOD__])) { @@ -323,7 +323,7 @@ class HubTools extends BaseHubSystem { } // END - if // Return it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $GLOBALS[__METHOD__] . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $GLOBALS[__METHOD__] . ' - EXIT!'); return $GLOBALS[__METHOD__]; } } diff --git a/application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php b/application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php index dc8058291..54f09bd29 100644 --- a/application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php +++ b/application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php @@ -57,7 +57,7 @@ class RawDataPoolMonitorVisitor extends BaseVisitor implements PoolVisitor, List */ public function visitPool (Poolable $poolInstance) { // A pool doesn't normally have any raw data waiting - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: poolInstance=' . $poolInstance->__toString() . ' - CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: poolInstance=' . $poolInstance->__toString() . ' - CALLED!'); } /** @@ -72,7 +72,7 @@ class RawDataPoolMonitorVisitor extends BaseVisitor implements PoolVisitor, List * traffic. This is why its method monitorIncomingRawData() is not * called. */ - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: listenerInstance=' . $listenerInstance->__toString() . ' - CALLED!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: listenerInstance=' . $listenerInstance->__toString() . ' - CALLED!'); } /** @@ -83,9 +83,9 @@ class RawDataPoolMonitorVisitor extends BaseVisitor implements PoolVisitor, List */ public function visitDecorator (BaseDecorator $decoratorInstance) { // Do monitor here - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting ' . $listenerInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting ' . $listenerInstance->__toString() . ' - CALLED!'); $decoratorInstance->monitorIncomingRawData(); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting ' . $listenerInstance->__toString() . ' - FINISH'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visiting ' . $listenerInstance->__toString() . ' - FINISH'); } } diff --git a/application/hub/classes/visitor/pool/shutdown/class_ShutdownListenerPoolVisitor.php b/application/hub/classes/visitor/pool/shutdown/class_ShutdownListenerPoolVisitor.php index 758f97b91..757252c63 100644 --- a/application/hub/classes/visitor/pool/shutdown/class_ShutdownListenerPoolVisitor.php +++ b/application/hub/classes/visitor/pool/shutdown/class_ShutdownListenerPoolVisitor.php @@ -56,13 +56,13 @@ class ShutdownListenerPoolVisitor extends BaseVisitor implements PoolVisitor { */ public function visitPool (Poolable $poolInstance) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $poolInstance->__toString() . ' - CALLED!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $poolInstance->__toString() . ' - CALLED!'); // Pre-shutdown the pool $poolInstance->preShutdown(); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $poolInstance->__toString() . ' - EXIT!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $poolInstance->__toString() . ' - EXIT!'); } /** @@ -73,13 +73,13 @@ class ShutdownListenerPoolVisitor extends BaseVisitor implements PoolVisitor { */ public function visitDecorator (Listenable $decoratorInstance) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $decoratorInstance->__toString() . ' - CALLED!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $decoratorInstance->__toString() . ' - CALLED!'); // Pre-shutdown the pool $decoratorInstance->doShutdown(); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $decoratorInstance->__toString() . ' - EXIT!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $decoratorInstance->__toString() . ' - EXIT!'); } /** @@ -90,13 +90,13 @@ class ShutdownListenerPoolVisitor extends BaseVisitor implements PoolVisitor { */ public function visitListener (Listenable $listenerInstance) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $listenerInstance->__toString() . ' - CALLED!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $listenerInstance->__toString() . ' - CALLED!'); // Pre-shutdown the pool $listenerInstance->doShutdown(); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $listenerInstance->__toString() . ' - EXIT!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $listenerInstance->__toString() . ' - EXIT!'); } }