$currentQuery = $this->getIteratorInstance()->current();
// Only while construction, else it would output to much!
- /* DEBUG: */ $this->debugOutput('CONNECTOR: Handling query ' . $currentQuery);
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTOR: Handling query ' . $currentQuery);
}
/**
$currentQueues = $this->getIteratorInstance()->current();
// Only while construction, else it would output to much!
- /* DEBUG: */ $this->debugOutput('CONNECTOR: Handling queue entry ' . $currentQueues);
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTOR: Handling queue entry ' . $currentQueues);
}
/**
*/
public function outputConsoleTeaser () {
// Output all lines
- $this->debugOutput(' ');
- $this->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...');
- $this->debugOutput('Copyright (c) 2011 Hub Developer Team');
- $this->debugOutput(' ');
- $this->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.');
- $this->debugOutput('This is free software, and you are welcome to redistribute it under certain');
- $this->debugOutput('conditions; see docs/COPYING for details.');
- $this->debugOutput(' ');
+ self::createDebugInstance(__CLASS__)->debugOutput(' ');
+ self::createDebugInstance(__CLASS__)->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...');
+ self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2011 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(' ');
}
/**
$recipient = $recipientIp . ':' . $recipientPort;
// Debug message
- $this->debugOutput('DATABASE-WRAPPER: sessionId[' . $protocol . ']=' . $sessionId . ' resolved as recipient=' . $recipient);
+ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: sessionId[' . $protocol . ']=' . $sessionId . ' resolved as recipient=' . $recipient);
} // END - if
// Return result
*/
private function getSenderSearchInstanceFromPackageData (array $packageData) {
// Get the instance
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: Searching for sender ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER]);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->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
*/
public function isSenderNewPeer (array $packageData, StoreableCriteria $dataSetInstance = NULL) {
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: ' . __FUNCTION__ . ' called with packageData()=' . count($packageData) . ' - ENTERED!');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: ' . __FUNCTION__ . ' called with packageData()=' . count($packageData) . ' - ENTERED!');
// Is always new peer by default
$isNewPeer = true;
$entries = $this->doSelectCountByCriteria($searchInstance, array(self::DB_COLUMN_PEER_SESSION_ID => true));
// Is it there?
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: entries=' . $entries);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: entries=' . $entries);
$isNewPeer = ($entries != 1);
// Return the result
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: isNewPeer=' . intval($isNewPeer) . ' - EXIT!');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: isNewPeer=' . intval($isNewPeer) . ' - EXIT!');
return $isNewPeer;
}
$this->queryInsertDataSet($dataSetInstance, array(self::DB_COLUMN_PEER_SESSION_ID => true));
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: Peer ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER] . ' has been registered.');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: Peer ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER] . ' has been registered.');
}
/**
}
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: Peer ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER] . ' has been registered/updated with state ' . $stateInstance->getStateName());
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: Peer ' . $packageData[NetworkPackage::PACKAGE_DATA_SENDER] . ' has been registered/updated with state ' . $stateInstance->getStateName());
}
/**
} // END - if
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: peerName=' . $peerName . ',peerPort=' . $peerPort . ' - UNFINISHED!');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: peerName=' . $peerName . ',peerPort=' . $peerPort . ' - UNFINISHED!');
}
/**
*/
public function isSamePeerState (ConnectionHelper $helperInstance, array $packageData) {
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: State ' . $helperInstance->getPrintableState() . ' needs to be checked it has changed ...');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->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);
$isSamePeerState = ($rowData[self::DB_COLUMN_PEER_STATE] == $helperInstance->getPrintableState());
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: state in database: ' . $rowData[self::DB_COLUMN_PEER_STATE] . ', new state: ' . $helperInstance->getPrintableState() . ',isSamePeerState=' . intval($isSamePeerState));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE-WRAPPER: state in database: ' . $rowData[self::DB_COLUMN_PEER_STATE] . ', new state: ' . $helperInstance->getPrintableState() . ',isSamePeerState=' . intval($isSamePeerState));
// Return it
return $isSamePeerState;
$chatInstance->enableIsActive();
// Debug message
- $this->debugOutput('BOOTSTRAP: The chat console has been activated.');
+ self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: The chat console has been activated.');
}
}
$cruncherInstance->enableIsActive();
// Debug message
- $this->debugOutput('BOOTSTRAP: The cruncher has been activated.');
+ self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: The cruncher has been activated.');
}
}
*/
public function processMessage ($messageContent, Receivable $packageInstance) {
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('ANNOUNCEMENT-ANSWER-TAG: messageContent(' . strlen($messageContent) . ')=' . $messageContent);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-ANSWER-TAG: messageContent(' . strlen($messageContent) . ')=' . $messageContent);
// Get a template instance from the factory
$templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_answer_template_class');
*/
if (is_null($value)) {
// Output a warning
- $this->debugOutput('ANNOUNCEMENT-ANSWER-TAG: Found not fully supported variable ' . $key . ' - skipping.');
+ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-ANSWER-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: */ $this->debugOutput('ANNOUNCEMENT-ANSWER-TAG: key=' . $key . ',value=' . $value);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-ANSWER-TAG: key=' . $key . ',value=' . $value);
// Set it now
$this->dataXmlNodes[$key] = $value;
*/
protected function initMessageConfigurationData (array $messageData) {
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('ANNOUNCEMENT-HANDLER: messageData=' . print_r($messageData, true));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER: messageData=' . print_r($messageData, true));
// "Walk" throught the translation array
foreach ($this->messageToConfig as $messageKey => $configKey) {
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('ANNOUNCEMENT-HANDLER: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]);
// Set the element in configuration
$this->getConfigInstance()->setConfigEntry($configKey, $messageData[$messageKey]);
// "Walk" throught the config-copy array
foreach ($this->configCopy as $targetKey => $sourceKey) {
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('ANNOUNCEMENT-HANDLER: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
// Copy from source to targetKey
$this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey));
// Are node id and session id the same?
if (($messageData[XmlSelfConnectTemplateEngine::SELF_CONNECT_DATA_NODE_ID] == $this->getNodeId()) && ($messageData[XmlSelfConnectTemplateEngine::SELF_CONNECT_DATA_SESSION_ID] == $this->getSessionId())) {
// Both are equal
- $this->debugOutput('SELF-CONNECT: Have connected to myself, both node and session id are equal!');
+ self::createDebugInstance(__CLASS__)->debugOutput('SELF-CONNECT: Have connected to myself, both node and session id are equal!');
// Get node instance ...
$nodeInstance = Registry::getRegistry()->getInstance('node');
$decodedData = false;
// Debug message
- //* NOISY-DEBUG: */ $this->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: 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
$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: */ $this->debugOutput('TCP-HANDLER: rawData[' . gettype($rawData) . ']=' . strlen($rawData) . ',resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',error=' . socket_strerror(socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE])));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-HANDLER: rawData[' . gettype($rawData) . ']=' . strlen($rawData) . ',resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE] . ',error=' . socket_strerror(socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE])));
// Is it valid?
if (socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]) == 11) {
// Debug message
- //* NOISY-DEBUG: */ $this->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: Ignoring error 11 (Resource temporary unavailable) from socket resource=' . $socketArray[BasePool::SOCKET_ARRAY_RESOURCE]);
/*
* Error code 11 (Resource temporary unavailable) can be safely
// 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: 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)
$sentBytes = socket_write($socketResource, $encodedData, ($bufferSize - $this->diff));
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: All sent! (LINE=' . __LINE__ . ')');
break;
}
// 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: 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: totalSentBytes=' . $totalSentBytes . ',diff=' . $this->diff);
return $totalSentBytes;
}
*/
public function doShutdown () {
// Debug message
- $this->debugOutput('HELPER: Shutting down socket resource ' . $this->getSocketResource());
+ self::createDebugInstance(__CLASS__)->debugOutput('HELPER: Shutting down socket resource ' . $this->getSocketResource());
// Clear any previous errors
socket_clear_error($this->getSocketResource());
*/
public function loadDescriptorXml () {
// Debug message
- $this->debugOutput('HELPER: Starting with announcement to upper hubs...');
+ self::createDebugInstance(__CLASS__)->debugOutput('HELPER: Starting with announcement to upper hubs...');
// Get a XML template instance
$templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_template_class');
*/
public function loadDescriptorXml () {
// Debug message
- $this->debugOutput('HELPER: Attempting to answer an announcement...');
+ self::createDebugInstance(__CLASS__)->debugOutput('HELPER: Attempting to answer an announcement...');
// Get a XML template instance
$templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_announcement_answer_template_class');
*/
public function loadDescriptorXml () {
// Debug message
- $this->debugOutput('HELPER: Attempting self-connect...');
+ self::createDebugInstance(__CLASS__)->debugOutput('HELPER: Attempting self-connect...');
// Get a XML template instance
$templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance('node_self_connect_template_class');
$this->maxBits = pow(2, $this->keyLength);
// Debug message
- $this->debugOutput('ITERATOR: maxBits=' . $this->maxBits . ',keyLength=' . $this->keyLength . ' bits');
+ self::createDebugInstance(__CLASS__)->debugOutput('ITERATOR: maxBits=' . $this->maxBits . ',keyLength=' . $this->keyLength . ' bits');
}
/**
$isInputBufferEmpty = $this->getPackageInstance()->getStackerInstance()->isStackEmpty(NetworkPackage::STACKER_NAME_DECODED_HANDLED);
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput('PACKAGE-ASSEMBLER: isInputBufferEmpty=' . intval($isInputBufferEmpty));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: isInputBufferEmpty=' . intval($isInputBufferEmpty));
// Return it
return $isInputBufferEmpty;
*/
private function handlePackageByUnhandledPackage (array $packageContent) {
// Debug message
- /* NOISY-DEBUG: */ $this->debugOutput('PACKAGE-ASSEMBLER: packageData[' . BaseRawDataHandler::PACKAGE_DECODED_DATA . ']=' . $packageContent[BaseRawDataHandler::PACKAGE_DECODED_DATA]);
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: packageData[' . BaseRawDataHandler::PACKAGE_DECODED_DATA . ']=' . $packageContent[BaseRawDataHandler::PACKAGE_DECODED_DATA]);
// Check for some conditions
if (!$this->ifInputBufferIsEmpty()) {
$this->pendingData .= $packageContent[BaseRawDataHandler::PACKAGE_DECODED_DATA];
// Debug message
- /* NOISY-DEBUG: */ $this->debugOutput('PACKAGE-ASSEMBLER: Partial data received. Waiting for more ... ( ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_DECODED_DATA]) . ' bytes)');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: Partial data received. Waiting for more ... ( ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_DECODED_DATA]) . ' bytes)');
} else {
// Debug message
- //* NOISY-DEBUG */ $this->debugOutput('packageContent=' . print_r($packageContent,true) . ',chunks='.print_r($chunks,true));
+ //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('packageContent=' . print_r($packageContent,true) . ',chunks='.print_r($chunks,true));
/*
* "explode" the string from 'decoded_data' with chunk separator to
$this->pendingData = '';
// Debug message
- /* NOISY-DEBUG: */ $this->debugOutput('PACKAGE-ASSEMBLER: Last block of partial data received. A total of ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_DECODED_DATA]) . ' bytes has been received.');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: Last block of partial data received. A total of ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_DECODED_DATA]) . ' bytes has been received.');
// Call the real handler method
$this->handlePackageByUnhandledPackage($packageContent);
assert(strlen($finalHash) > 0);
// Is the pointer already initialized?
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': finalHash[' . gettype($finalHash) . ']=' . $finalHash);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': finalHash[' . gettype($finalHash) . ']=' . $finalHash);
assert(isset($this->chunkPointers[$finalHash]));
// Return it
assert(isset($this->chunkPointers[$finalHash]));
// Count one up
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': finalHash[' . gettype($finalHash) . ']=' . $finalHash);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': finalHash[' . gettype($finalHash) . ']=' . $finalHash);
$this->chunkPointers[$finalHash]++;
}
$this->generateHashFromRawData($lastChunk);
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': Adding EOP chunk with size of ' . strlen($chunkData) . ',finalHash=' . $finalHash . ' ...');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': Adding EOP chunk with size of ' . strlen($chunkData) . ',finalHash=' . $finalHash . ' ...');
// Add it as regular chunk
$this->addChunkData($finalHash, $chunkData);
// Calculate real (data) chunk size
$dataChunkSize = $this->getDataChunkSizeFromHash($finalHash);
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': dataChunkSize=' . $dataChunkSize);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': dataChunkSize=' . $dataChunkSize);
// Init variables
$chunkHash = '';
} // END - for
// Debug output
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': Raw data of ' . strlen($rawData) . ' bytes has been fragmented into ' . count($this->chunks[$finalHash]) . ' chunk(s).');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': 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);
// Add it to the array
if ($prepend === true) {
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': Prepending ' . strlen($rawData) . ' bytes of a chunk, finalHash=' . $finalHash . ' ...');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': 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: */ $this->debugOutput(__METHOD__ . ': Appending ' . strlen($rawData) . ' bytes of a chunk, finalHash=' . $finalHash . ' ...');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': Appending ' . strlen($rawData) . ' bytes of a chunk, finalHash=' . $finalHash . ' ...');
$this->chunks[$finalHash][] = $rawData;
$this->chunkHashes[$finalHash][] = $rawDataHash;
}
}
// Return final hash
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': finalHash[' . gettype($finalHash) . ']=' . $finalHash);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': finalHash[' . gettype($finalHash) . ']=' . $finalHash);
return $finalHash;
}
*/
public function getNextRawDataChunk ($finalHash) {
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': finalHash[' . gettype($finalHash) . ']=' . $finalHash);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': finalHash[' . gettype($finalHash) . ']=' . $finalHash);
try {
// Get current chunk index
// 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: */ $this->debugOutput(__METHOD__. ': finalHash=' . $finalHash . ',current=' . $current . ' - No more entries found!');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__. ': finalHash=' . $finalHash . ',current=' . $current . ' - No more entries found!');
return array();
} // END - if
// Debug message
- //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__. ': finalHash=' . $finalHash . ',current=' . $current . ',chunkHashes()=' . count($this->chunkHashes[$finalHash]) .' - Entry choosen ...');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__. ': finalHash=' . $finalHash . ',current=' . $current . ',chunkHashes()=' . count($this->chunkHashes[$finalHash]) .' - Entry choosen ...');
// Generate the array
$rawDataChunk = array(
*/
public function resetSerialNumber () {
// Debug message
- /* NOISY-DEBUG: */ $this->debugOutput('FRAGMENTER: Resetting serial number, previous=' . $this->serialNumber);
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('FRAGMENTER: Resetting serial number, previous=' . $this->serialNumber);
// Reset serial number
$this->serialNumber = 0;
// Is this cruncher virgin?
if (!$stateInstance->isCruncherStateVirgin()) {
// This cruncher is not virgin, so skip it
- $this->debugOutput('PRODUCER: The cruncher is not virgin. stateInstance=' . $stateInstance->__toString() . '');
+ self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: The cruncher is not virgin. stateInstance=' . $stateInstance->__toString() . '');
return;
} elseif (!$this->getIteratorInstance()->valid()) {
// This producer's iterator has finished its assignment
- $this->debugOutput('PRODUCER: Finished creating keys. iteratorinstance=' . $this->getIteratorInstance()->__toString() . '');
+ self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: Finished creating keys. iteratorinstance=' . $this->getIteratorInstance()->__toString() . '');
return;
}
// Is the per-work unit limit reached?
if ($this->isOutgoingQueueLimitReached('cruncher_per_unit_key_limit')) {
// @TODO Do something with it
- $this->debugOutput('currentKey(b64)="' . base64_encode($currentKey) . '" needs to be processed.');
+ self::createDebugInstance(__CLASS__)->debugOutput('currentKey(b64)="' . base64_encode($currentKey) . '" needs to be processed.');
// At last re-init the stack
$this->initOutgoingQueue();
$encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
// Debug message
- $this->debugOutput('PRODUCER: An encrypted, random message has been generated. Generating keys ...');
+ self::createDebugInstance(__CLASS__)->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);
*/
private function initObjectRegistry () {
// Output debug message
- $this->debugOutput('TAGS: Initializing object registry - START');
+ self::createDebugInstance(__CLASS__)->debugOutput('TAGS: Initializing object registry - START');
// Get the application instance
$applicationInstance = Registry::getRegistry()->getInstance('app');
$this->getTemplateInstance()->renderXmlContent();
// Output debug message
- $this->debugOutput('TAGS: Initializing object registry - FINISHED');
+ self::createDebugInstance(__CLASS__)->debugOutput('TAGS: Initializing object registry - FINISHED');
}
/**
// "Walk" over all tags
foreach ($this->getTags() as $tag) {
// Debug output
- $this->debugOutput('TAGS: Validating tag ' . $tag . ' ...');
+ self::createDebugInstance(__CLASS__)->debugOutput('TAGS: Validating tag ' . $tag . ' ...');
// Get an array from this tag
$entry = $objectRegistryInstance->getArrayFromKey($tag);
*/
public function visitDecorator (BaseDecorator $decoratorInstance) {
// Do monitor here
- //* NOISY-DEBUG: */ $this->debugOutput('VISITOR: Visiting ' . $listenerInstance->__toString() . ' - START');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('VISITOR: Visiting ' . $listenerInstance->__toString() . ' - START');
$decoratorInstance->monitorIncomingRawData($this->getReceiverInstance());
- //* NOISY-DEBUG: */ $this->debugOutput('VISITOR: Visiting ' . $listenerInstance->__toString() . ' - FINISH');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('VISITOR: Visiting ' . $listenerInstance->__toString() . ' - FINISH');
}
}
*/
public function visitPool (Poolable $poolInstance) {
// Debug message
- $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - START');
+ self::createDebugInstance(__CLASS__)->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - START');
// Pre-shutdown the pool
$poolInstance->preShutdown();
// Debug message
- $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - FINISHED');
+ self::createDebugInstance(__CLASS__)->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - FINISHED');
}
/**
*/
public function visitDecorator (Listenable $decoratorInstance) {
// Debug message
- $this->debugOutput('VISITOR: Visit of ' . $decoratorInstance->__toString() . ' - START');
+ self::createDebugInstance(__CLASS__)->debugOutput('VISITOR: Visit of ' . $decoratorInstance->__toString() . ' - START');
// Pre-shutdown the pool
$decoratorInstance->doShutdown();
// Debug message
- $this->debugOutput('VISITOR: Visit of ' . $decoratorInstance->__toString() . ' - FINISHED');
+ self::createDebugInstance(__CLASS__)->debugOutput('VISITOR: Visit of ' . $decoratorInstance->__toString() . ' - FINISHED');
}
/**
*/
public function visitListener (Listenable $listenerInstance) {
// Debug message
- $this->debugOutput('VISITOR: Visit of ' . $listenerInstance->__toString() . ' - START');
+ self::createDebugInstance(__CLASS__)->debugOutput('VISITOR: Visit of ' . $listenerInstance->__toString() . ' - START');
// Pre-shutdown the pool
$listenerInstance->doShutdown();
// Debug message
- $this->debugOutput('VISITOR: Visit of ' . $listenerInstance->__toString() . ' - FINISHED');
+ self::createDebugInstance(__CLASS__)->debugOutput('VISITOR: Visit of ' . $listenerInstance->__toString() . ' - FINISHED');
}
}