From 9a1243bea20f7602ef7cdfe912a7db5ee958fba8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 25 Feb 2013 08:08:10 +0000 Subject: [PATCH] Added line numbers to debug lines as this will become the 'norm' --- .../class_PackageRecipientDiscovery.php | 6 ++-- .../socket/class_PackageSocketDiscovery.php | 20 +++++------ .../factories/socket/class_SocketFactory.php | 10 +++--- .../handler/chunks/class_ChunkHandler.php | 16 ++++----- .../class_NodeMessageAnnouncementHandler.php | 6 ++-- ...odeMessageRequestNodeListAnswerHandler.php | 4 +-- ...lass_NodeMessageRequestNodeListHandler.php | 4 +-- .../network/tcp/class_TcpRawDataHandler.php | 8 ++--- .../main/handler/tasks/class_TaskHandler.php | 18 +++++----- .../connection/class_BaseConnectionHelper.php | 34 +++++++++---------- .../tcp/class_TcpConnectionHelper.php | 4 +-- .../helper/dht/class_DhtBootstrapHelper.php | 2 +- .../class_NodeAnnouncementHelper.php | 2 +- ...ss_NodeAnnouncementMessageAnswerHelper.php | 2 +- ...NodeRequestNodeListMessageAnswerHelper.php | 2 +- .../class_NodeSelfConnectHelper.php | 2 +- .../class_NodeRequestNodeListHelper.php | 2 +- application/hub/main/pools/class_BasePool.php | 6 ++-- .../listener/class_DefaultListenerPool.php | 6 ++-- .../main/pools/peer/class_DefaultPeerPool.php | 12 +++---- .../connection/class_ConnectionRegistry.php | 4 +-- .../registry/socket/class_SocketRegistry.php | 16 ++++----- .../main/tags/package/class_PackageTags.php | 6 ++-- .../class_XmlObjectRegistryTemplateEngine.php | 2 +- application/hub/main/tools/class_HubTools.php | 14 ++++---- 25 files changed, 104 insertions(+), 104 deletions(-) diff --git a/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php b/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php index f1ef94a14..ce5d075a7 100644 --- a/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php +++ b/application/hub/main/discovery/package/class_PackageRecipientDiscovery.php @@ -46,7 +46,7 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable $discoveryInstance->setListInstance($listInstance); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY: Initialized.'); + self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __LINE__ . ']: Initialized.'); // Return the prepared instance return $discoveryInstance; @@ -111,10 +111,10 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable */ // Debug output (may flood) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY: Recipient ' . $recipient[0] . ' matches own ip (' . HubTools::determineOwnExternalIp() . ' or ' . $this->getConfigInstance()->getServerAddress() . ')'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __LINE__ . ']: Recipient ' . $recipient[0] . ' matches own ip (' . HubTools::determineOwnExternalIp() . ' or ' . $this->getConfigInstance()->getServerAddress() . ')'); } else { // Debug output (may flood) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY: Recipient ' . $recipient[0] . ' is different than own external ip (' . HubTools::determineOwnExternalIp() . ') nor internal ip (' . $this->getConfigInstance()->getServerAddress() . '), need to forward (not yet implemented)!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __LINE__ . ']: Recipient ' . $recipient[0] . ' is different than own external ip (' . HubTools::determineOwnExternalIp() . ') nor internal ip (' . $this->getConfigInstance()->getServerAddress() . '), need to forward (not yet implemented)!'); // This package is to be delivered to someone else, so add it $this->getListInstance()->addEntry('ip_port', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]); diff --git a/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php b/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php index ca5f47c67..93f30ae30 100644 --- a/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php +++ b/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php @@ -42,7 +42,7 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc $discoveryInstance = new PackageSocketDiscovery(); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY: Initialized.'); + self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: Initialized.'); // Return the prepared instance return $discoveryInstance; @@ -57,7 +57,7 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc */ public function discoverListenerInstance ($protocolName, array $packageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY: protocolName=' . $protocolName . ' - ENTERED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: protocolName=' . $protocolName . ' - ENTERED!'); /* * Get the listener pool instance, we need to lookup the matching @@ -75,17 +75,17 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc */ foreach ($poolInstance->getPoolEntriesInstance()->getArrayFromGroup($protocolName) as $listenerInstance) { // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY: protocolName=' . $protocolName . ',listenerInstance=' . $listenerInstance->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: protocolName=' . $protocolName . ',listenerInstance=' . $listenerInstance->__toString()); // 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: Listener is accepting package data.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: Listener is accepting package data.'); break; } // END - if // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY: Listener is NOT accepting package data.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: Listener is NOT accepting package data.'); } // END - foreach // Return it @@ -144,13 +144,13 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc // Try to create a new socket resource try { // Possibly noisy debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY: Trying to establish a ' . strtoupper($protocolName) . ' connection to ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: Trying to establish a ' . strtoupper($protocolName) . ' connection to ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' ...'); // Get a socket resource from our factory (if succeeded) $socketResource = SocketFactory::createSocketFromPackageData($packageData, $protocolName); } catch (SocketConnectionException $e) { // The connection fails of being established, so log it away - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY: Caught ' . $e->__toString() . ',message=' . $e->getMessage()); + self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage()); } } // END - if @@ -160,20 +160,20 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc $helperInstance = Registry::getRegistry()->getInstance('connection'); // Possibly noisy debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY: Going to resolve socket from peer state and given package data ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __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: Cannot discover socket resource for recipient ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ': ' . $e->getMessage()); + self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __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: socketResource=' . $socketResource . ',packageData=' . print_r($packageData, true)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: socketResource=' . $socketResource . ',packageData=' . print_r($packageData, true)); return $socketResource; } } diff --git a/application/hub/main/factories/socket/class_SocketFactory.php b/application/hub/main/factories/socket/class_SocketFactory.php index 5ba0c468f..de4341cda 100644 --- a/application/hub/main/factories/socket/class_SocketFactory.php +++ b/application/hub/main/factories/socket/class_SocketFactory.php @@ -48,7 +48,7 @@ class SocketFactory extends ObjectFactory { $registryKey = 'socket_' . $protocolName . '_' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]; // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY: Trying to find a socket with registryKey=' . $registryKey); + self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __LINE__ . ']: Trying to find a socket with registryKey=' . $registryKey); // Is the key there? if (Registry::getRegistry()->instanceExists($registryKey)) { @@ -59,19 +59,19 @@ class SocketFactory extends ObjectFactory { $socketResource = $containerInstance->getSocketResource(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY: Using socket ' . $socketResource . '(' . gettype($socketResource) . ') from registry.'); + self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __LINE__ . ']: Using socket ' . $socketResource . '(' . gettype($socketResource) . ') from registry.'); } else { // Construct configuration entry for object factory and get it $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry($protocolName . '_connection_helper_class'); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY: Going to use class ' . $className . ' for creating a socket resource ...'); + self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __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 - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY: Created socket ' . $socketResource . '(' . gettype($socketResource) . ') from class ' . $className . '.'); + self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __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)); @@ -80,7 +80,7 @@ class SocketFactory extends ObjectFactory { Registry::getRegistry()->addInstance($registryKey, $containerInstance); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY: Socket is now registered in registry.'); + self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-FACTORY[' . __LINE__ . ']: Socket is now registered in registry.'); } // Return the resource diff --git a/application/hub/main/handler/chunks/class_ChunkHandler.php b/application/hub/main/handler/chunks/class_ChunkHandler.php index e8b104ad0..1f3506797 100644 --- a/application/hub/main/handler/chunks/class_ChunkHandler.php +++ b/application/hub/main/handler/chunks/class_ChunkHandler.php @@ -153,7 +153,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable $chunkHash = $this->getCryptoInstance()->hashString($chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA], $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH], false); // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER: chunkHash=' . $chunkHash . ',chunkSplits[chunk_hash]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] . ',chunkSplits[serial]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ',chunkSplits[raw_data]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __LINE__ . ']: chunkHash=' . $chunkHash . ',chunkSplits[chunk_hash]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] . ',chunkSplits[serial]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ',chunkSplits[raw_data]=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA]); // Check it $isValid = ($chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] === $chunkHash); @@ -195,7 +195,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER: serialNumber=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ',hash=' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __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]; @@ -282,7 +282,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable $nextSerial = $this->getFragmenterInstance()->getNextHexSerialNumber(); // Debug output - //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER: serialNumber=' . $serialNumber . ',nextSerial=' . $nextSerial); + //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __LINE__ . ']: serialNumber=' . $serialNumber . ',nextSerial=' . $nextSerial); // Is it not the same? Then re-request it if ($serialNumber != $nextSerial) { @@ -313,7 +313,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable // That went well, so start assembling all chunks foreach ($this->finalPackageChunks['content'] as $serialNumber => $content) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER: serialNumber=' . $serialNumber . ' - validating ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __LINE__ . ']: serialNumber=' . $serialNumber . ' - validating ...'); //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('finalPackageChunks=' . print_r($this->finalPackageChunks,true) . 'chunkHashes=' . print_r($this->chunkHashes,true)); // Is this chunk valid? This should be the case @@ -330,7 +330,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable } // END - foreach // Debug output - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER: eopChunk[1]=' . $this->eopChunk[1] . ',' . chr(10) . 'index=' . (count($this->chunkHashes) - 2) . ',' . chr(10) . 'chunkHashes='.print_r($this->chunkHashes,true)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __LINE__ . ']: eopChunk[1]=' . $this->eopChunk[1] . ',' . chr(10) . 'index=' . (count($this->chunkHashes) - 2) . ',' . chr(10) . '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]); @@ -435,7 +435,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: Chunk content is not validating against given hash.'); + self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __LINE__ . ']: Chunk content is not validating against given hash.'); // Re-request this chunk (trust the hash in index # 0) $this->rerequestChunkBySplitsArray($chunkSplits); @@ -447,7 +447,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: Chunk serial number ' . $chunkSplits[self::CHUNK_SPLITS_INDEX_SERIAL] . ' for hash ' . $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH] . ' is invalid.'); + self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __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); @@ -531,7 +531,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable break; default: // Invalid step found - self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER: Invalid step ' . $this->finalPackageChunks['assemble_steps'] . ' detected.'); + self::createDebugInstance(__CLASS__)->debugOutput('CHUNK-HANDLER[' . __LINE__ . ']: Invalid step ' . $this->finalPackageChunks['assemble_steps'] . ' detected.'); break; } // END - switch } diff --git a/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php b/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php index f1f954c90..46b5bd6f9 100644 --- a/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php +++ b/application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php @@ -137,12 +137,12 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl */ protected function initMessageConfigurationData (array $messageData) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER: messageData=' . print_r($messageData, true)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __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: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __LINE__ . ']: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]); // Set the element in configuration $this->getConfigInstance()->setConfigEntry($configKey, $messageData[$messageKey]); @@ -151,7 +151,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: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __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/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php b/application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php index fd35c7e13..912357980 100644 --- a/application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php +++ b/application/hub/main/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: messageData=' . print_r($messageData, true)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANSWER-HANDLER[' . __LINE__ . ']: messageData=' . print_r($messageData, true)); // Add all ements foreach ($this->messageDataElements as $key) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANSWER-HANDLER: messageData[' . $key . ']=' . $messageData[$key]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANSWER-HANDLER[' . __LINE__ . ']: messageData[' . $key . ']=' . $messageData[$key]); // Is it there? assert(isset($messageData[$key])); diff --git a/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php b/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php index 871bc6372..143afbd22 100644 --- a/application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php +++ b/application/hub/main/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: messageData=' . print_r($messageData, true)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(' REQUEST-HANDLER[' . __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: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REQUEST-HANDLER[' . __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/main/handler/network/tcp/class_TcpRawDataHandler.php b/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php index 61338d029..fc9c94f91 100644 --- a/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php +++ b/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php @@ -66,7 +66,7 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { $this->setErrorCode(self::SOCKET_ERROR_UNHANDLED); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER: Handling TCP package from resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',type=' . $socketArray[BasePool::SOCKET_ARRAY_CONN_TYPE] . ',last error=' . socket_strerror(socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __LINE__ . ']: Handling TCP package from resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',type=' . $socketArray[BasePool::SOCKET_ARRAY_CONN_TYPE] . ',last error=' . socket_strerror(socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]))); /* * Read the raw data from socket. If you change PHP_BINARY_READ to @@ -76,13 +76,13 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { $rawData = socket_read($socketArray[BasePool::SOCKET_ARRAY_RESOURCE], $this->getConfigInstance()->getConfigEntry('tcp_buffer_length'), PHP_BINARY_READ); // Debug output of read data length - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER: rawData[' . gettype($rawData) . ']=' . strlen($rawData) . ',MD5=' . md5($rawData) . ',resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',error=' . socket_strerror(socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]))); - //* NOISY-DEBUG: */ if ($rawData !== false) self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER: rawData=' . $rawData); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __LINE__ . ']: rawData[' . gettype($rawData) . ']=' . strlen($rawData) . ',MD5=' . md5($rawData) . ',resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',error=' . socket_strerror(socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]))); + //* NOISY-DEBUG: */ if ($rawData !== false) self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __LINE__ . ']: rawData=' . $rawData); // Is it valid? if (socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]) == 11) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER: Ignoring error 11 (Resource temporary unavailable) from socket resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER[' . __LINE__ . ']: Ignoring error 11 (Resource temporary unavailable) from socket resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE]); /* * Error code 11 (Resource temporary unavailable) can be safely diff --git a/application/hub/main/handler/tasks/class_TaskHandler.php b/application/hub/main/handler/tasks/class_TaskHandler.php index 398a21f1d..0467df236 100644 --- a/application/hub/main/handler/tasks/class_TaskHandler.php +++ b/application/hub/main/handler/tasks/class_TaskHandler.php @@ -48,7 +48,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $handlerInstance = new TaskHandler(); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Initializing task handler.'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Initializing task handler.'); // Init the task list $handlerInstance->setListInstance(ObjectFactory::createObjectByConfiguredName('task_list_class')); @@ -64,7 +64,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $handlerInstance->registerTask('idle_loop', $taskInstance); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Task handler initialized.'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Task handler initialized.'); // Return the prepared instance return $handlerInstance; @@ -107,7 +107,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $updateTask = true; // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms'); } // END - if // Get time difference from interval delay @@ -164,13 +164,13 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { */ private function unregisterTask (array $taskData) { // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Removing task ' . $taskData['id'] . ' from queue - START'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Removing task ' . $taskData['id'] . ' from queue - START'); // Remove the entry $this->getListInstance()->removeEntry('tasks', $taskData); // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Removing task ' . $taskData['id'] . ' from queue - FINISHED'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Removing task ' . $taskData['id'] . ' from queue - FINISHED'); } /** @@ -211,7 +211,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $this->getListInstance()->addEntry('tasks', $taskEntry); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Task registered: taskName=' . $taskName . + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Task registered: taskName=' . $taskName . ' (taskInstance=' . $taskInstance->__toString() . ')' . ', startupDelay=' . $taskEntry['task_startup_delay'] . 'ms' . ', intervalDelay=' . $taskEntry['task_interval_delay'] . 'ms' . @@ -265,7 +265,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $this->getListInstance()->getIterator()->rewind(); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Shutting down all ' . $this->getListInstance()->count() . ' tasks...'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Shutting down all ' . $this->getListInstance()->count() . ' tasks...'); // Remember all tasks that has been shutdown for removal $tasks = array(); @@ -279,7 +279,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $currentTask = $this->getListInstance()->getIterator()->current(); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Shutting down task ' . $currentTask['id'] . ' (taskInstance=' . $currentTask['task_instance']->__toString() . ') ...'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Shutting down task ' . $currentTask['id'] . ' (taskInstance=' . $currentTask['task_instance']->__toString() . ') ...'); // Shutdown the task $currentTask['task_instance']->accept($this->getVisitorInstance()); @@ -292,7 +292,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { } // END - while // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER: Shutdown of all tasks completed.'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Shutdown of all tasks completed.'); // Remove all tasks foreach ($tasks as $entry) { diff --git a/application/hub/main/helper/connection/class_BaseConnectionHelper.php b/application/hub/main/helper/connection/class_BaseConnectionHelper.php index 362ca0087..efe7bbc88 100644 --- a/application/hub/main/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/main/helper/connection/class_BaseConnectionHelper.php @@ -242,7 +242,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $timeout = $this->getConfigInstance()->getConfigEntry('socket_timeout_seconds'); // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: Trying to connect to ' . $recipientData[0] . ':' . $recipientData[1] . ' with socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' ...'); + self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Trying to connect to ' . $recipientData[0] . ':' . $recipientData[1] . ' with socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' ...'); // Try to connect until it is connected while ($isConnected = !@socket_connect($socketResource, $recipientData[0], $recipientData[1])) { @@ -335,7 +335,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: currentFinalHash=' . $this->currentFinalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: currentFinalHash=' . $this->currentFinalHash); // Get the next raw data chunk from the fragmenter $rawDataChunk = $this->getFragmenterInstance()->getNextRawDataChunk($this->currentFinalHash); @@ -345,18 +345,18 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $chunkData = array_values($rawDataChunk); // Is the required data there? - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: chunkHashes[]=' . count($chunkHashes) . ',chunkData[]=' . count($chunkData)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: chunkHashes[]=' . count($chunkHashes) . ',chunkData[]=' . count($chunkData)); //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->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: Returning ' . strlen($chunkData[0]) . ' bytes from ' . __METHOD__ . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Returning ' . strlen($chunkData[0]) . ' bytes from ' . __METHOD__ . ' ...'); return $chunkData[0]; } else { // Return zero string - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: Returning zero bytes from ' . __METHOD__ . '!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Returning zero bytes from ' . __METHOD__ . '!'); return ''; } } @@ -398,7 +398,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, while (strlen($dataStream) > 0) { // Convert the package data array to a raw data stream $dataStream = $this->getRawDataFromPackageArray($packageData); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); $rawData .= $dataStream; } // END - while @@ -409,7 +409,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $encodedData = $this->getOutputStreamInstance()->streamData($rawData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: rawData()=' . strlen($rawData) . ',encodedData()=' . strlen($encodedData)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: rawData()=' . strlen($rawData) . ',encodedData()=' . strlen($encodedData)); // Calculate difference $this->diff = $bufferSize - strlen($encodedData); @@ -423,15 +423,15 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Deliver all data while ($sentBytes !== false) { // And deliver it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: Sending out ' . strlen($encodedData) . ' bytes,bufferSize=' . $bufferSize . ',diff=' . $this->diff); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Sending out ' . strlen($encodedData) . ' bytes,bufferSize=' . $bufferSize . ',diff=' . $this->diff); if ($this->diff >= 0) { // Send all out (encodedData is smaller than or equal buffer size) - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: MD5=' . md5(substr($encodedData, 0, ($bufferSize - $this->diff)))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, ($bufferSize - $this->diff)))); $sentBytes = socket_write($socketResource, $encodedData, ($bufferSize - $this->diff)); } else { // Send buffer size out - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: MD5=' . md5(substr($encodedData, 0, $bufferSize))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, $bufferSize))); $sentBytes = socket_write($socketResource, $encodedData, $bufferSize); } @@ -444,7 +444,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, throw new InvalidSocketException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); } elseif (($sentBytes == 0) && (strlen($encodedData) > 0)) { // Nothing sent means we are done - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: All sent! (LINE=' . __LINE__ . ')'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); break; } @@ -455,7 +455,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $totalSentBytes += $sentBytes; // Cut out the last unsent bytes - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: Sent out ' . $sentBytes . ' of ' . strlen($encodedData) . ' bytes ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Sent out ' . $sentBytes . ' of ' . strlen($encodedData) . ' bytes ...'); $encodedData = substr($encodedData, $sentBytes); // Calculate difference again @@ -464,13 +464,13 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Can we abort? if (strlen($encodedData) <= 0) { // Abort here, all sent! - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: All sent! (LINE=' . __LINE__ . ')'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); break; } // END - if } // END - while // Return sent bytes - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: totalSentBytes=' . $totalSentBytes . ',diff=' . $this->diff); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: totalSentBytes=' . $totalSentBytes . ',diff=' . $this->diff); return $totalSentBytes; } @@ -480,7 +480,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, * @return void */ protected final function markConnectionShuttedDown () { - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: ' . $this->__toString() . ' has been marked as shutted down'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: ' . $this->__toString() . ' has been marked as shutted down'); $this->shuttedDown = true; // And remove the (now invalid) socket @@ -493,7 +493,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: ' . $this->__toString() . ',shuttedDown=' . intval($this->shuttedDown)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: ' . $this->__toString() . ',shuttedDown=' . intval($this->shuttedDown)); return $this->shuttedDown; } @@ -626,7 +626,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, * @return void */ protected function socketErrorOperationInProgressHandler ($socketResource, array $recipientData) { - self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: Operation is now in progress, this is usual for non-blocking connections and is no bug.'); + self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Operation is now in progress, this is usual for non-blocking connections and is no bug.'); } } diff --git a/application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php b/application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php index c8f63c9de..0fbfee373 100644 --- a/application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php +++ b/application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php @@ -93,7 +93,7 @@ class TcpConnectionHelper extends BaseConnectionHelper implements ConnectionHelp $recipientData = explode(':', HubTools::resolveSessionId($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])); } catch (NoValidHostnameException $e) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER: Failed to resolve ' . $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ':' . $e->getMessage()); + self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __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_ip'))) == $helperInstance->getConfigInstance()->getConfigEntry('external_ip')) { @@ -140,7 +140,7 @@ class TcpConnectionHelper extends BaseConnectionHelper implements ConnectionHelp */ public function doShutdown () { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER: Shutting down socket resource ' . $this->getSocketResource()); + self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __LINE__ . ']: Shutting down socket resource ' . $this->getSocketResource()); // Clear any previous errors socket_clear_error($this->getSocketResource()); diff --git a/application/hub/main/helper/dht/class_DhtBootstrapHelper.php b/application/hub/main/helper/dht/class_DhtBootstrapHelper.php index ee3afc770..d1ea54ae6 100644 --- a/application/hub/main/helper/dht/class_DhtBootstrapHelper.php +++ b/application/hub/main/helper/dht/class_DhtBootstrapHelper.php @@ -59,7 +59,7 @@ class DhtBootstrapHelper extends BaseHubSystemHelper implements HelpableDht { */ public function loadDescriptorXml () { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HELPER: Starting with DHT boostrap ...'); + self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __LINE__ . ']: Starting with DHT boostrap ...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('dht_bootstrap_template_class'); diff --git a/application/hub/main/helper/node/announcement/class_NodeAnnouncementHelper.php b/application/hub/main/helper/node/announcement/class_NodeAnnouncementHelper.php index 6c63651b1..5dc897159 100644 --- a/application/hub/main/helper/node/announcement/class_NodeAnnouncementHelper.php +++ b/application/hub/main/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: Starting with announcement to upper hubs...'); + self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __LINE__ . ']: Starting with announcement to upper hubs...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_template_class'); diff --git a/application/hub/main/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php b/application/hub/main/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php index dc511678c..29437635f 100644 --- a/application/hub/main/helper/node/answer/announcement/class_NodeAnnouncementMessageAnswerHelper.php +++ b/application/hub/main/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: Attempting to answer an announcement...'); + self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __LINE__ . ']: Attempting to answer an announcement...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_answer_template_class'); diff --git a/application/hub/main/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php b/application/hub/main/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php index 0964e9a9a..88ea6c8dd 100644 --- a/application/hub/main/helper/node/answer/requests/class_NodeRequestNodeListMessageAnswerHelper.php +++ b/application/hub/main/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: Attempting to answer a request: node-list...'); + self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __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/main/helper/node/connection/class_NodeSelfConnectHelper.php b/application/hub/main/helper/node/connection/class_NodeSelfConnectHelper.php index f1746dce1..0f9076030 100644 --- a/application/hub/main/helper/node/connection/class_NodeSelfConnectHelper.php +++ b/application/hub/main/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: Attempting self-connect...'); + self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __LINE__ . ']: Attempting self-connect...'); // Get a XML template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_self_connect_template_class'); diff --git a/application/hub/main/helper/node/requests/class_NodeRequestNodeListHelper.php b/application/hub/main/helper/node/requests/class_NodeRequestNodeListHelper.php index d8868295e..8eddba930 100644 --- a/application/hub/main/helper/node/requests/class_NodeRequestNodeListHelper.php +++ b/application/hub/main/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: Attempting to request: node-list...'); + self::createDebugInstance(__CLASS__)->debugOutput('HELPER[' . __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/main/pools/class_BasePool.php b/application/hub/main/pools/class_BasePool.php index cd4184609..c65f8266b 100644 --- a/application/hub/main/pools/class_BasePool.php +++ b/application/hub/main/pools/class_BasePool.php @@ -105,7 +105,7 @@ class BasePool extends BaseHubSystem implements Visitable { */ public function accept (Visitor $visitorInstance) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - START'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - START'); // Visit this pool $visitorInstance->visitPool($this); @@ -133,7 +133,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: Going to visit pooled object ' . $poolEntry->__toString() . ' with visitor ' . $visitorInstance->__toString() . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-POOL[' . __LINE__ . ']: Going to visit pooled object ' . $poolEntry->__toString() . ' with visitor ' . $visitorInstance->__toString() . ' ...'); $poolEntry->accept($visitorInstance); } else { // Cannot visit this entry @@ -145,7 +145,7 @@ class BasePool extends BaseHubSystem implements Visitable { } // END - while // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - FINISHED'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: ' . $visitorInstance->__toString() . ' has visited - FINISHED'); } /** diff --git a/application/hub/main/pools/listener/class_DefaultListenerPool.php b/application/hub/main/pools/listener/class_DefaultListenerPool.php index b5db596fe..c716b56bd 100644 --- a/application/hub/main/pools/listener/class_DefaultListenerPool.php +++ b/application/hub/main/pools/listener/class_DefaultListenerPool.php @@ -61,7 +61,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener { // Debug message self::createDebugInstance(__CLASS__)->debugOutput( - 'POOL: Listener ' . $listenerInstance->__toString() . + 'POOL[' . __LINE__ . ']: Listener ' . $listenerInstance->__toString() . ' listening to ' . $listenerInstance->getListenAddress() . ':' . $listenerInstance->getListenPort() . ' added to listener pool.' ); @@ -74,7 +74,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener { */ public function doShutdown () { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('POOL: Shutting down listener pool - START'); + self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: Shutting down listener pool - START'); // Get a new visitor $visitorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_listener_pool_visitor_class'); @@ -83,7 +83,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener { $this->accept($visitorInstance); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('POOL: Shutting down listener pool - FINISHED'); + self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: Shutting down listener pool - FINISHED'); } } diff --git a/application/hub/main/pools/peer/class_DefaultPeerPool.php b/application/hub/main/pools/peer/class_DefaultPeerPool.php index 44959858f..e2fce1b11 100644 --- a/application/hub/main/pools/peer/class_DefaultPeerPool.php +++ b/application/hub/main/pools/peer/class_DefaultPeerPool.php @@ -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: Socket resource is server socket (' . $socketResource . '). This is not a bug.'); + self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: Socket resource is server socket (' . $socketResource . '). This is not a bug.'); } // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('POOL: Adding peer ' . $peerName . ',socketResource=' . $socketResource . ',type=' . $connectionType); + self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: Adding peer ' . $peerName . ',socketResource=' . $socketResource . ',type=' . $connectionType); // Construct the array $socketArray = array( @@ -227,7 +227,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { assert(count($recipientIpArray) == 2); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL: Checking ' . count($this->getAllSockets()) . ' socket(s),recipientIpArray[0]=' . $recipientIpArray[0] . ',recipientIpArray[1]=' . $recipientIpArray[1] . ' ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: Checking ' . count($this->getAllSockets()) . ' socket(s),recipientIpArray[0]=' . $recipientIpArray[0] . ',recipientIpArray[1]=' . $recipientIpArray[1] . ' ...'); // Default is all sockets $sockets = $this->getAllSockets(); @@ -246,7 +246,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: Skipping server socket ' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ' ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: Skipping server socket ' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ' ...'); continue; } // END - if @@ -263,13 +263,13 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { $socketResource = $socketArray[self::SOCKET_ARRAY_RESOURCE]; // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL: 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__)->debugOutput('POOL[' . __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: socketResource[' . gettype($socketResource) . ']=' . $socketResource); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __LINE__ . ']: socketResource[' . gettype($socketResource) . ']=' . $socketResource); return $socketResource; } } diff --git a/application/hub/main/registry/connection/class_ConnectionRegistry.php b/application/hub/main/registry/connection/class_ConnectionRegistry.php index 0dc3fa1e4..cf144a95d 100644 --- a/application/hub/main/registry/connection/class_ConnectionRegistry.php +++ b/application/hub/main/registry/connection/class_ConnectionRegistry.php @@ -172,7 +172,7 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC $socketInstance = ObjectFactory::CreateObjectByConfiguredName('socket_container_class', array($socketResource, $connectionInstance, $packageData)); // We have a sub-registry, the socket key and the socket, now we need to put all together - /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-REGISTRY: socketKey=' . $socketKey . ',socketResource=' . $socketResource . ' - adding socket container instance ...'); + /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-REGISTRY[' . __LINE__ . ']: socketKey=' . $socketKey . ',socketResource=' . $socketResource . ' - adding socket container instance ...'); $registryInstance->addInstance($socketKey, $socketInstance); } @@ -221,7 +221,7 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC // This is always a SubRegistry instance foreach ($registryInstance->getInstanceRegistry() as $subKey => $containerInstance) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-REGISTRY: key=' . $key . ',subKey=' . $subKey . ',containerInstance=' . $containerInstance->__toString()); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-REGISTRY[' . __LINE__ . ']: key=' . $key . ',subKey=' . $subKey . ',containerInstance=' . $containerInstance->__toString()); // This is a ConnectionContainer instance, so does the recipient match? if ($containerInstance->ifAddressMatches($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) { diff --git a/application/hub/main/registry/socket/class_SocketRegistry.php b/application/hub/main/registry/socket/class_SocketRegistry.php index 332f7b0cb..e9498c579 100644 --- a/application/hub/main/registry/socket/class_SocketRegistry.php +++ b/application/hub/main/registry/socket/class_SocketRegistry.php @@ -150,7 +150,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $key = $this->getRegistryKeyFromProtocol($protocolInstance); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ' - Trying to get instance ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ' - Trying to get instance ...'); // Get the registry $registryInstance = $this->getInstance($key); @@ -159,12 +159,12 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $socketKey = $this->getSubRegistryKey($protocolInstance); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: protocol=' . $protocolInstance->getProtocol() . ',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: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey)); // Get the instance $registeredInstance = $registryInstance->getInstance($socketKey); @@ -173,7 +173,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $isRegistered = (($registeredInstance instanceof SocketContainer) && ($registeredInstance->ifSocketResourceMatches($socketResource))); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: Final result: isRegistered(' . $socketResource . ')=' . intval($isRegistered)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: Final result: isRegistered(' . $socketResource . ')=' . intval($isRegistered)); } // END - if } // END - if @@ -206,7 +206,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke // Does the instance exist? if (!$this->isProtocolRegistered($protocolInstance)) { // No, not found so we create a sub registry (not needed to configure!) - $registryInstance = SubRegistry::createSubRegistry(); + $registryInstance = SubREGISTRY[' . __LINE__ . ']::createSubRegistry(); // Now we can create the sub-registry for this protocol $this->addInstance($this->getRegistryKeyFromProtocol($protocolInstance), $registryInstance); @@ -222,7 +222,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke $socketInstance = ObjectFactory::CreateObjectByConfiguredName('socket_container_class', array($socketResource, $protocolInstance, $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: socketKey=' . $socketKey . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - adding socket container instance ...'); + /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: socketKey=' . $socketKey . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - adding socket container instance ...'); $registryInstance->addInstance($socketKey, $socketInstance); } @@ -275,12 +275,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: key=' . $key . ',registryInstance=' . $registryInstance->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __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: key=' . $key . ',subKey=' . $subKey . ',containerInstance=' . $containerInstance->__toString()); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __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]))) { diff --git a/application/hub/main/tags/package/class_PackageTags.php b/application/hub/main/tags/package/class_PackageTags.php index fd0cd8a1b..b46eb3437 100644 --- a/application/hub/main/tags/package/class_PackageTags.php +++ b/application/hub/main/tags/package/class_PackageTags.php @@ -69,7 +69,7 @@ class PackageTags extends BaseTags implements Tagable { */ private function initObjectRegistry () { // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TAGS: Initializing object registry - START'); + self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __LINE__ . ']: Initializing object registry - START'); // Get the application instance $applicationInstance = Registry::getRegistry()->getInstance('app'); @@ -87,7 +87,7 @@ class PackageTags extends BaseTags implements Tagable { $this->getTemplateInstance()->renderXmlContent(); // Output debug message - self::createDebugInstance(__CLASS__)->debugOutput('TAGS: Initializing object registry - FINISHED'); + self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __LINE__ . ']: Initializing object registry - FINISHED'); } /** @@ -123,7 +123,7 @@ class PackageTags extends BaseTags implements Tagable { // "Walk" over all tags foreach ($this->getTags() as $tag) { // Debug output - self::createDebugInstance(__CLASS__)->debugOutput('TAGS: Validating tag ' . $tag . ' ...'); + self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __LINE__ . ']: Validating tag ' . $tag . ' ...'); // Get an array from this tag $entry = $objectRegistryInstance->getArrayFromKey(XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_NAME, $tag); diff --git a/application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php b/application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php index 751e9f8ab..15a1bb4c2 100644 --- a/application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php +++ b/application/hub/main/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: Adding object type ' . $characters . ' to registry.'); + self::createDebugInstance(__CLASS__)->debugOutput('TAGS[' . __LINE__ . ']: Adding object type ' . $characters . ' to registry.'); } // END - if // Add it to the registry diff --git a/application/hub/main/tools/class_HubTools.php b/application/hub/main/tools/class_HubTools.php index 8c7c85d5d..17ad9dec3 100644 --- a/application/hub/main/tools/class_HubTools.php +++ b/application/hub/main/tools/class_HubTools.php @@ -155,19 +155,19 @@ class HubTools extends BaseHubSystem { // Does it match a direct ip:port? (hint: see www.regexlib.com for the regular expression) if (preg_match('/((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})/', $sessionId)) { // Direct ip:port found - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS: Direct ip:port ' . $sessionId . ' detected.'); + self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __LINE__ . ']: Direct ip:port ' . $sessionId . ' detected.'); } elseif (isset($selfInstance->sessionIdCache[$sessionId])) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS: Using entry from sessionIdCache[] array.'); + self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __LINE__ . ']: Using entry from sessionIdCache[] array.'); // Found in cache! $recipient = $selfInstance->sessionIdCache[$sessionId]; // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS: sessionIdCache[' . $sessionId . ']=' . $recipient); + self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __LINE__ . ']: sessionIdCache[' . $sessionId . ']=' . $recipient); } elseif (preg_match('/([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}:([0-9]{3,5})/', $sessionId)) { // Hostname:port found - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS: hostname:port ' . $sessionId . ' detected.'); + self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __LINE__ . ']: hostname:port ' . $sessionId . ' detected.'); // Hostname:port found $hostnameArray = explode(':', $sessionId); @@ -185,16 +185,16 @@ class HubTools extends BaseHubSystem { } // END - if // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS: hostname:port ' . $sessionId . ' resolved to ' . $recipient); + self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __LINE__ . ']: hostname:port ' . $sessionId . ' resolved to ' . $recipient); } elseif (preg_match('/([a-f0-9]{' . $selfInstance->getSessionIdLength() . '})/', $sessionId)) { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS: Using internal session id resolver.'); + self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __LINE__ . ']: Using internal session id resolver.'); // Resolve session id into a ip:port combination $recipient = $selfInstance->resolveIpPortBySessionId($sessionId); // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS: Session id ' . $sessionId . ' resolved to ' . $recipient); + self::createDebugInstance(__CLASS__)->debugOutput('HUB-TOOLS[' . __LINE__ . ']: Session id ' . $sessionId . ' resolved to ' . $recipient); } else { // Invalid session id throw new InvalidSessionIdException($sessionId, self::EXCEPTION_SESSION_ID_IS_INVALID); -- 2.39.2