Changed all true/false to TRUE/FALSE respectively as PHP constants are better than...
authorRoland Häder <roland@mxchange.org>
Thu, 18 Jul 2013 12:51:15 +0000 (12:51 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 18 Jul 2013 12:51:15 +0000 (12:51 +0000)
35 files changed:
application/hub/exceptions/requests/class_NoRequestNodeListAttemptedException.php
application/hub/exceptions/requests/class_RequestNotAcceptedException.php
application/hub/interfaces/handler/chunks/class_HandleableChunks.php
application/hub/interfaces/helper/nodes/class_NodeHelper.php
application/hub/main/class_BaseHubSystem.php
application/hub/main/commands/console/class_HubConsoleMainCommand.php
application/hub/main/dht/node/class_NodeDhtFacade.php
application/hub/main/discovery/socket/class_PackageSocketDiscovery.php
application/hub/main/handler/chunks/class_ChunkHandler.php
application/hub/main/handler/message-types/anouncement/class_NodeMessageAnnouncementHandler.php
application/hub/main/handler/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php
application/hub/main/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php
application/hub/main/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php
application/hub/main/handler/tasks/class_TaskHandler.php
application/hub/main/helper/connection/class_BaseConnectionHelper.php
application/hub/main/listener/tcp/class_TcpListener.php
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/package/assembler/class_PackageAssembler.php
application/hub/main/package/class_NetworkPackage.php
application/hub/main/package/fragmenter/class_PackageFragmenter.php
application/hub/main/pools/class_BasePool.php
application/hub/main/producer/class_BaseProducer.php
application/hub/main/registry/connection/class_ConnectionRegistry.php
application/hub/main/registry/socket/class_SocketRegistry.php
application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php
application/hub/main/template/answer/announcement/class_XmlAnnouncementAnswerTemplateEngine.php
application/hub/main/template/answer/requests/class_XmlRequestNodeListAnswerTemplateEngine.php
application/hub/main/template/bootstrap/class_XmlDhtBootstrapTemplateEngine.php
application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php
application/hub/main/template/entries/class_XmlRequestNodeListEntryTemplateEngine.php
application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php
application/hub/main/template/producer/test_units/class_XmlCruncherTestUnitTemplateEngine.php
application/hub/main/template/requests/class_XmlRequestNodeListTemplateEngine.php
application/hub/main/tools/class_HubTools.php
index.php

index e02318eee3f312784e990ff09bb1c0d35522c985..0ae3dc0cad8fc4166303623d0a8977d4987d0d37 100644 (file)
@@ -31,11 +31,11 @@ class NoRequestNodeListAttemptedException extends FrameworkException {
         */
        public function __construct (array $messageData, $code) {
                // Construct the message
-               $message = sprintf("[%s:%d] This node (%s) didn't except a node-list request: %s",
+               $message = sprintf('[%s:%d] This node (%s) didn't except a node-list request: %s',
                        $messageData[0]->__toString(),
                        $this->getLine(),
                        $messageData[1]->__toString(),
-                       print_r($messageData[2], true)
+                       print_r($messageData[2], TRUE)
                );
 
                // Call parent exception constructor
index 6fa9c0d9fcdf964cf3fc5dc755ae1d926378ce7f..102ac990b3ad2a49ddfdca8288bb707526f7f80e 100644 (file)
@@ -33,11 +33,11 @@ class RequestNotAcceptedException extends FrameworkException {
         */
        public function __construct (array $messageData, $code) {
                // Construct the message
-               $message = sprintf("[%s:%d] This node (%s) does not accept request: %s",
+               $message = sprintf('[%s:%d] This node (%s) does not accept request: %s',
                        $messageData[0]->__toString(),
                        $this->getLine(),
                        $messageData[1]->__toString(),
-                       print_r($messageData[2], true)
+                       print_r($messageData[2], TRUE)
                );
 
                // Call parent exception constructor
index b9d4b4724f8f61838692b6f03ae03787730eeab9..16691f2ddb419ada62817297ebe2b75b00cec818 100644 (file)
@@ -82,7 +82,7 @@ interface HandleableChunks extends Handleable {
        /**
         * Checks whether the raw package data has been assembled back together.
         * This can be safely assumed when rawPackageData is not empty and the
-        * collection of all chunks is false (because initHandler() will reset it).
+        * collection of all chunks is FALSE (because initHandler() will reset it).
         *
         * @return      $isRawPackageDataAvailable      Whether raw package data is available
         */
index 280fd9d8c42528e1caa689a482ec7c5fad403814..33d0978bf4c8aebdaed010b55baaa27ec16bcf17 100644 (file)
@@ -60,7 +60,7 @@ interface NodeHelper extends Helper, AddableCriteria {
 
        /**
         * Activates the hub by doing some final preparation and setting
-        * $hubIsActive to true
+        * $hubIsActive to TRUE.
         *
         * @param       $requestInstance        A Requestable class
         * @param       $responseInstance       A Responseable class
index 6d34489d6321b371faf8894690769f5e4f19520c..d20ec95dbdf3893c148189e483cae8f8eaa3f39f 100644 (file)
@@ -452,7 +452,7 @@ class BaseHubSystem extends BaseFrameworkSystem {
                $chunkSplits = explode(PackageFragmenter::CHUNK_DATA_HASH_SEPARATOR, $chunks[count($chunks) - 1]);
 
                // Make sure chunks with only 3 elements are parsed (for details see ChunkHandler)
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('eopChunk=' . $chunks[count($chunks) - 1] . ',chunkSplits=' . print_r($chunkSplits, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('eopChunk=' . $chunks[count($chunks) - 1] . ',chunkSplits=' . print_r($chunkSplits, TRUE));
                assert(count($chunkSplits) == 3);
 
                // Validate final chunk
index 581315540fc8d26a065316ebd4e66da6174237ce..bbfcab5cf70a15e8fd76d606ea0e991e68a11257 100644 (file)
@@ -80,7 +80,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable {
                /*
                 * -------------------------- Hub activation --------------------------
                 * Activates the node by doing some final preparation steps and setting
-                * the attribute $hubIsActive to true
+                * the attribute $hubIsActive to TRUE.
                 */
                $nodeInstance->activateNode($requestInstance, $responseInstance);
 
index 484b0c75099c0133ffd8944d456a7788866df5c2..e37b76cf6510463e8d9bd5463a7f7bbe39ed6bc5 100644 (file)
@@ -169,7 +169,7 @@ class NodeDhtFacade extends BaseDht implements Distributable, Registerable {
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, true) . ',handlerInstance=' . $handlerInstance->__toString() . ',forceUpdate=' . intval($forceUpdate) . ',count(getSearchData())=' . count($handlerInstance->getSearchData()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, TRUE) . ',handlerInstance=' . $handlerInstance->__toString() . ',forceUpdate=' . intval($forceUpdate) . ',count(getSearchData())=' . count($handlerInstance->getSearchData()));
 
                // Search for the node's session id and external IP/hostname + TCP/UDP listen port
                foreach ($handlerInstance->getSearchData() as $key) {
@@ -228,7 +228,7 @@ class NodeDhtFacade extends BaseDht implements Distributable, Registerable {
                assert((isset($messageData[$excludeKey])) && (isset($messageData[$andKey])));
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-FACADE[' . __LINE__ . ']: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, TRUE));
 
                // Get a search criteria class
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
index 9745185fc692007eb507edb22c3947dd7870e37f..840b9b668f8188553b3cbf7082dad19676de1ec8 100644 (file)
@@ -122,7 +122,7 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('protocolName=' . $protocolName . ',packageData=' . print_r($packageData, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('protocolName=' . $protocolName . ',packageData=' . print_r($packageData, TRUE));
 
                /*
                 * Now we have the listener instance, we can determine the right
@@ -134,12 +134,12 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc
 
                // Debug message
                if (is_resource($socketResource)) {
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',error=' . socket_strerror(socket_last_error($socketResource)) . ',packageData=' . print_r($packageData, true));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',error=' . socket_strerror(socket_last_error($socketResource)) . ',packageData=' . print_r($packageData, TRUE));
                } else {
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',packageData=' . print_r($packageData, true));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',packageData=' . print_r($packageData, TRUE));
                }
 
-               // Is it false, the recipient isn't known to us and we have no connection to it
+               // Is it FALSE, the recipient isn't known to us and we have no connection to it
                if (($socketResource === FALSE) || (!is_resource($socketResource)) || (socket_last_error($socketResource) > 0)) {
                        // Try to create a new socket resource
                        try {
@@ -168,12 +168,12 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc
                        // This cannot be fixed, so log it away
                        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'
+                       // Make any failed attempts to 'FALSE'
                        $socketResource = FALSE;
                }
 
                // And return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-DISCOVERY[' . __LINE__ . ']: 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;
        }
 }
index 5a188e5257160f1a479401c290bfc1e08d8246cd..a7708cf2f4fce359d1468bd9895b12fd33602f5f 100644 (file)
@@ -129,7 +129,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                        // ... and for the hashes
                        'hashes'         => array(),
                        // ... marker for that the final array is complete for assembling all chunks
-                       'is_complete'    => false,
+                       'is_complete'    => FALSE,
                        // ... steps done to assemble all chunks
                        'assemble_steps' => 0,
                );
@@ -152,7 +152,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
         */
        private function isChunkHashValid (array $chunkSplits) {
                // Now hash the raw data again
-               $chunkHash = $this->getCryptoInstance()->hashString($chunkSplits[self::CHUNK_SPLITS_INDEX_RAW_DATA], $chunkSplits[self::CHUNK_SPLITS_INDEX_HASH], false);
+               $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[' . __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]);
@@ -172,7 +172,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
         */
        private function isSerialNumberValid ($serialNumber) {
                // Check it
-               $isValid = ((strlen($serialNumber) == PackageFragmenter::MAX_SERIAL_LENGTH) && ($this->hexval($serialNumber, false) === $serialNumber));
+               $isValid = ((strlen($serialNumber) == PackageFragmenter::MAX_SERIAL_LENGTH) && ($this->hexval($serialNumber, FALSE) === $serialNumber));
 
                // Return result
                return $isValid;
@@ -246,9 +246,9 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
         * @return      void
         */
        private function preparePackageAssmble () {
-               // Make sure both arrays have same count (this however should always be true)
+               // Make sure both arrays have same count (this however should always be TRUE)
                assert(count($this->finalPackageChunks['hashes']) == count($this->finalPackageChunks['content']));
-               //* DIE: */ exit(__METHOD__ . ':finalPackageChunks='.print_r($this->finalPackageChunks['content'],true));
+               //* DIE: */ exit(__METHOD__ . ':finalPackageChunks='.print_r($this->finalPackageChunks['content'], TRUE));
 
                /*
                 * Remove last element (hash chunk) from 'hashes'. This hash will never
@@ -316,7 +316,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                foreach ($this->finalPackageChunks['content'] as $serialNumber => $content) {
                        // Debug message
                        //* 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));
+                       //* 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
                        assert($this->isChunkHashValid(array(
@@ -332,7 +332,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
                } // END - foreach
 
                // Debug output
-               //* 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));
+               //* 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]);
@@ -346,7 +346,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
         */
        private function verifyRawPackageData () {
                // Hash the raw package data for final verification
-               $finalHash = $this->getCryptoInstance()->hashString($this->rawPackageData, $this->eopChunk[0], false);
+               $finalHash = $this->getCryptoInstance()->hashString($this->rawPackageData, $this->eopChunk[0], FALSE);
 
                // Is it the same?
                assert($finalHash == $this->eopChunk[0]);
@@ -541,7 +541,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable
        /**
         * Checks whether the raw package data has been assembled back together.
         * This can be safely assumed when rawPackageData is not empty and the
-        * collection of all chunks is false (because initHandler() will reset it).
+        * collection of all chunks is FALSE (because initHandler() will reset it).
         *
         * @return      $isRawPackageDataAvailable      Whether raw package data is available
         */
index 46b5bd6f909cd28a25b3e8297991a5120fe37f27..4473eeeedeab2452c42865a024042ab03b3cf12f 100644 (file)
@@ -137,7 +137,7 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl
         */
        protected function initMessageConfigurationData (array $messageData) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANNOUNCEMENT-HANDLER[' . __LINE__ . ']: 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) {
index 912357980825f286b26045875c5e113efd7e7c31..342f8c5ee5940a86ed093bae317bd0a6940a6e79 100644 (file)
@@ -107,7 +107,7 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme
                parent::addArrayToDataSet($dataSetInstance, $messageData);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('ANSWER-HANDLER[' . __LINE__ . ']: 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) {
index 2eb3c37ef224448ae608cc114d0d1e9e4dff99ef..2d3cf33704af268acf46d0c25927d14b518e27dc 100644 (file)
@@ -119,7 +119,7 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
         */
        protected function initMessageConfigurationData (array $messageData) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('REQUEST-HANDLER[' . __LINE__ . ']: 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) {
index 446ac055f0110d9491563457df1f53a705473ed6..3cab8b1837bc0d5b1b2b3e380266f37cac61bb4f 100644 (file)
@@ -69,7 +69,7 @@ class NodeMessageSelfConnectHandler extends BaseMessageHandler implements Handle
                } else {
                        // Something really horrible happened
                        // @TODO Throw an exception here instead of dying
-                       $this->debugInstance(__METHOD__ . ': ids mismatching! messageData=' . print_r($messageData, true));
+                       $this->debugInstance(__METHOD__ . ': ids mismatching! messageData=' . print_r($messageData, TRUE));
                }
        }
 
index 271a0a9c6713abd7ca3da1796ba499d3cc8b9555..f1a92b1e6235af6f0cffdf5d2ec8b326fc54821e 100644 (file)
@@ -99,7 +99,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        // Should we start now?
                        if ($diff < $currentTask['task_startup_delay']) {
                                // Skip this silently
-                               return false;
+                               return;
                        } // END - if
 
                        // Launch the task and mark it as updated
@@ -122,7 +122,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        } // END - if
 
                        // Skip this silently
-                       return false;
+                       return;
                } // END - if
 
                // Set last activity
@@ -186,11 +186,11 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        // Identifier for the generateHash() method
                        'id'                  => $taskName,
                        // Whether the task is started
-                       'task_started'        => false,
+                       'task_started'        => FALSE,
                        // Whether the task is paused (not yet implemented)
-                       'task_paused'         => false,
+                       'task_paused'         => FALSE,
                        // Whether the task can be paused (not yet implemented)
-                       'task_pauseable'      => true,
+                       'task_pauseable'      => TRUE,
                        // Timestamp of registration
                        'task_registered'     => $this->getMilliTime(),
                        // Last activity timestamp
index c9d7fa3c4b487eec698bc8a9da2a455f4fdad6d1..116903ec58f972bd33018e00d542e05624b3757c 100644 (file)
@@ -346,7 +346,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable,
 
                // Is the required data there?
                //* 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));
+               //* 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];
@@ -487,7 +487,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable,
                $this->shuttedDown = TRUE;
 
                // And remove the (now invalid) socket
-               $this->setSocketResource(false);
+               $this->setSocketResource(FALSE);
        }
 
        /**
index 680ab86b5e45b492f15e3bcebb5fa74124255f7b..ac9b0f8ee47d20b0a548314543a0b745568858a6 100644 (file)
@@ -217,14 +217,14 @@ class TcpListener extends BaseListener implements Listenable {
                // Some new peers found?
                if ($left < 1) {
                        // Debug message
-                       //* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __LINE__ . ']: left=' . $left . ',serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, true));
+                       //* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __LINE__ . ']: left=' . $left . ',serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE));
 
                        // Nothing new found
                        return;
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __LINE__ . ']: serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('TCP-LISTENER[' . __LINE__ . ']: serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE));
 
                // Do we have changed peers?
                if (in_array($this->getSocketResource(), $readers)) {
@@ -258,7 +258,7 @@ class TcpListener extends BaseListener implements Listenable {
                        // Output result (only for debugging!)
                        /*
                        $option = socket_get_option($newSocket, SOL_SOCKET, SO_RCVTIMEO);
-                       self::createDebugInstance(__CLASS__)->debugOutput('SO_RCVTIMEO[' . gettype($option) . ']=' . print_r($option, true));
+                       self::createDebugInstance(__CLASS__)->debugOutput('SO_RCVTIMEO[' . gettype($option) . ']=' . print_r($option, TRUE));
                        */
 
                        // Enable SO_OOBINLINE
index 1b052c5b909073397a5c4135d050f209078b1522..ac6362881b19a3a526c1e69a9bb8b13aaae113e6 100644 (file)
@@ -52,18 +52,18 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
        private $queueConnectorInstance = NULL;
 
        /**
-        * Whether this node is anncounced (KEEP ON false!)
+        * Whether this node is anncounced (keep on FALSE!)
         * @deprecated
         */
        private $hubIsAnnounced = FALSE;
 
        /**
-        * Whether this hub is active (default: false)
+        * Whether this hub is active (default: FALSE)
         */
        private $isActive = FALSE;
 
        /**
-        * Whether this node accepts announcements (default: false)
+        * Whether this node accepts announcements (default: FALSE)
         */
        private $acceptAnnouncements = FALSE;
 
@@ -510,7 +510,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
 
        /**
         * Activates the hub by doing some final preparation and setting
-        * $hubIsActive to true
+        * $hubIsActive to TRUE.
         *
         * @param       $requestInstance        A Requestable class
         * @param       $responseInstance       A Responseable class
@@ -681,7 +681,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
        /**
         * Enables whether this node accepts announcements
         *
-        * @param       $acceptAnnouncements    Whether this node accepts announcements (default: true)
+        * @param       $acceptAnnouncements    Whether this node accepts announcements (default: TRUE)
         * @return      void
         */
        protected final function enableAcceptingAnnouncements ($acceptAnnouncements = TRUE) {
@@ -697,7 +697,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria {
                /*
                 * Only 'regular' nodes does not accept such requests, checking
                 * HubRegularNode is faster, but if e.g. HubRegularI2PNode will be
-                * added then the next check will be true.
+                * added then the next check will be TRUE.
                 */
                $acceptsRequest = ((!$this instanceof HubRegularNode) && ($this->getRequestInstance()->getRequestElement('mode') != self::NODE_TYPE_REGULAR));
 
index 866bc2ea0777b2112853a627d53121e42f2368cf..938f6c62159be116dff4e7094766a22d05fb6f7a 100644 (file)
@@ -151,7 +151,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: Partial data received. Waiting for more ... ( ' . strlen($packageContent[BaseRawDataHandler::PACKAGE_RAW_DATA]) . ' bytes)');
                } else {
                        // Debug message
-                       /* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: packageContent=' . print_r($packageContent,true) . ',chunks='.print_r($chunks,true));
+                       /* DEBUG */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-ASSEMBLER: packageContent=' . print_r($packageContent, TRUE) . ',chunks='.print_r($chunks, TRUE));
                }
        }
 
index d7507b03fb6e1b32b7a5422c61df9049cf50686a..df1ff642ae204087d87e3caad946e6769eac2acc 100644 (file)
@@ -560,7 +560,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         */
        private function generatePackageSignature ($content, $senderId) {
                // Hash content and sender id together, use md5() as last algo
-               $hash = md5($this->getCryptoInstance()->hashString($senderId . $content, $this->getPrivateKey(), false));
+               $hash = md5($this->getCryptoInstance()->hashString($senderId . $content, $this->getPrivateKey(), FALSE));
 
                // Encrypt the content again with the hash as a key
                $encryptedContent = $this->getCryptoInstance()->encryptString($content, $hash);
@@ -586,7 +586,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
 
                // Is it the same?
                //$isSignatureValid = 
-               exit(__METHOD__.': signature='.$signature.chr(10).',decodedArray='.print_r($decodedArray,true));
+               exit(__METHOD__.': signature='.$signature.chr(10).',decodedArray='.print_r($decodedArray, TRUE));
        }
 
        /**
@@ -869,7 +869,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                $decodedData = $handlerInstance->getNextRawData();
 
                // Very noisy debug message:
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __LINE__ . ']: decodedData[' . gettype($decodedData) . ']=' . print_r($decodedData, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __LINE__ . ']: decodedData[' . gettype($decodedData) . ']=' . print_r($decodedData, TRUE));
 
                // And push it on our stack
                $this->getStackerInstance()->pushNamed(self::STACKER_NAME_DECODED_INCOMING, $decodedData);
@@ -960,7 +960,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
         */
        public function clearAllStacker () {
                // Call the init method to force re-initialization
-               $this->initStackers(true);
+               $this->initStackers(TRUE);
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __LINE__ . ']: All stacker have been re-initialized.');
@@ -1134,7 +1134,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R
                $messageArray[self::MESSAGE_ARRAY_DATA][self::MESSAGE_ARRAY_TYPE] = $messageArray[self::MESSAGE_ARRAY_TYPE];
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __LINE__ . ']: messageArray=' . print_r($messageArray, true));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __LINE__ . ']: messageArray=' . print_r($messageArray, TRUE));
 
                // Create a handler instance from given message type
                $handlerInstance = MessageTypeHandlerFactory::createMessageTypeHandlerInstance($messageArray[self::MESSAGE_ARRAY_TYPE]);
index 519537af5219e934b584b30008ecd104f118c5f4..64bbb932435445fe2240bf17a5af1eb1de5c8736 100644 (file)
@@ -403,7 +403,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                $rawData = self::HASH_CHUNK_IDENTIFIER . implode(self::CHUNK_HASH_SEPARATOR, $this->chunkHashes[$finalHash]);
 
                // Prepend chunk
-               $this->addChunkData($finalHash, $rawData, true);
+               $this->addChunkData($finalHash, $rawData, TRUE);
        }
 
        /**
@@ -480,7 +480,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
         *
         * @param       $finalHash              Final hash for faster lookup
         * @return      $rawDataChunk   Raw package data chunk
-        * @throws      AssertionException      If $finalHash was not 'true'
+        * @throws      AssertionException      If $finalHash was not 'TRUE'
         */
        public function getNextRawDataChunk ($finalHash) {
                // Debug message
@@ -490,7 +490,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                        // Get current chunk index
                        $current = $this->getCurrentChunkPointer($finalHash);
                } catch (AssertionException $e) {
-                       // This may happen when the final hash is true
+                       // This may happen when the final hash is TRUE
                        if ($finalHash === TRUE) {
                                // Set current to null
                                $current = NULL;
index 025385875820a290f21e8328bf615da8496ee8e6..f29e7c254475ce2462c5791aeaad67422108690d 100644 (file)
@@ -170,7 +170,7 @@ class BasePool extends BaseHubSystem implements Visitable {
         */
        protected function isValidConnectionType ($connectionType) {
                // Is it valid?
-               $isValid = in_array($connectionType, $this->connectionTypes, true);
+               $isValid = in_array($connectionType, $this->connectionTypes, TRUE);
 
                // Return result
                return $isValid;
index 0dca07cadbdddaee24df6bbb1eda32304673f94d..38f8c9b68bb0173a2a568f579c0c80e0e665d390 100644 (file)
@@ -133,7 +133,7 @@ abstract class BaseProducer extends BaseFrameworkSystem {
         * @return      void
         */
        protected function initOutgoingQueue () {
-               $this->getOutgoingQueueInstance()->initStacker(self::STACKER_NAME_OUT_QUEUE, true);
+               $this->getOutgoingQueueInstance()->initStacker(self::STACKER_NAME_OUT_QUEUE, TRUE);
        }
 
        /**
@@ -162,7 +162,7 @@ abstract class BaseProducer extends BaseFrameworkSystem {
         * @return      void
         */
        protected function initIncomingQueue () {
-               $this->getIncomingQueueInstance()->initStacker(self::STACKER_NAME_IN_QUEUE, true);
+               $this->getIncomingQueueInstance()->initStacker(self::STACKER_NAME_IN_QUEUE, TRUE);
        }
 
        /**
index 4c786b3f9b61b8fa2972b4e9e9d1013ffbdfd752..11e43cdb284a1e2d7c9aa588455ec84350e830a8 100644 (file)
@@ -108,7 +108,7 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
 
        /**
         * Checks whether given socket resource is registered. If $socketResource is
-        * false only the instance will be checked.
+        * FALSE only the instance will be checked.
         *
         * @param       $connectionInstance             An instance of a ConnectionHelper class
         * @param       $socketResource                 A valid socket resource
@@ -185,7 +185,7 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
         */
        public function getRegisteredConnectionResource (ConnectionHelper $connectionInstance) {
                // The socket must be registered before we can return it
-               if (!$this->isConnectionRegistered($connectionInstance, false)) {
+               if (!$this->isConnectionRegistered($connectionInstance, FALSE)) {
                        // Throw the exception
                        throw new NoConnectionRegisteredException ($connectionInstance, self::CONNECTION_NOT_REGISTERED);
                } // END - if
index b75c78204ad76a89782e70d32b911e72322f9f9b..d03d2eead0992095d264f4d335c28a0243e732e7 100644 (file)
@@ -131,7 +131,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
 
        /**
         * Checks whether given socket resource is registered. If $socketResource is
-        * false only the instance will be checked.
+        * FALSE only the instance will be checked.
         *
         * @param       $protocolInstance       An instance of a ProtocolHandler class
         * @param       $socketResource         A valid socket resource
index 684e6dafc8991caf75ec35f954ecbb7965be1508..44c766e5004394bd0f40a475ef233bb562158cb9 100644 (file)
@@ -92,7 +92,7 @@ class XmlAnnouncementTemplateEngine extends BaseXmlTemplateEngine implements Com
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                /*
index 17feefd456b20ee14dad667ee2f53b4857260e0b..88b0457b579be68d16c3a38998e5ee07ee7db97a 100644 (file)
@@ -98,7 +98,7 @@ class XmlAnnouncementAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine im
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                /*
index b53290d0ef1d4ba35845a90b539212441649bb18..6989cee62b499370e5b95056311b2f783e1f8724 100644 (file)
@@ -88,7 +88,7 @@ class XmlRequestNodeListAnswerTemplateEngine extends BaseXmlAnswerTemplateEngine
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                /*
index fd1606333ef11704c60b230932e1e461a607469c..812e99d2d54d19450ba3c5c3751adab1c07a0e2b 100644 (file)
@@ -92,7 +92,7 @@ class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements Com
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                /*
index 6afba47d87d607e6669e15992a6fbd524bec9dc7..94e08d88a08404c8b403bb979f5eda042fd3e5f7 100644 (file)
@@ -83,7 +83,7 @@ class XmlSelfConnectTemplateEngine extends BaseXmlTemplateEngine implements Comp
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                /*
index 499d00e4ce64c1b5bc7c5b9a8be4d5b2fd980c93..4d50c1fede42e2791a97c94632d820302a869b79 100644 (file)
@@ -70,7 +70,7 @@ class XmlRequestNodeListEntryTemplateEngine extends BaseXmlTemplateEngine implem
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                // Assign data with matching variable here
index ce64d5244d7d1ff6e77e512e5076e518531d38ff..b1b7027c217d2525c92b15d58d4e2040b899630a 100644 (file)
@@ -96,7 +96,7 @@ class XmlObjectRegistryTemplateEngine extends BaseXmlTemplateEngine implements C
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                // Get current XML node name as an array index
index 3da75d4b1fa42896e7130294ddcdd3e354118f03..9f75d26a95542fc5e717865c3eb08e344c5d99a9 100644 (file)
@@ -85,7 +85,7 @@ class XmlCruncherTestUnitTemplateEngine extends BaseXmlTemplateEngine implements
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                // Assign the found characters to variable and use the last entry from
index 2824834285e95c4b9b27b2dc6209eaad7e842267..879f7775e9ed0338066ffd5cca892701cedd4789 100644 (file)
@@ -80,7 +80,7 @@ class XmlRequestNodeListTemplateEngine extends BaseXmlTemplateEngine implements
                // Is this string empty?
                if (empty($characters)) {
                        // Then skip it silently
-                       return false;
+                       return;
                } // END - if
 
                // Assign data with matching variable here
index 17ad9dec3a5bf516b32ba5a84607093edd3e3566..33f1a9d83d8c67f7442ca69d388ae46ffdbb9e4e 100644 (file)
@@ -131,7 +131,7 @@ class HubTools extends BaseHubSystem {
 
                // And ask it for session id by given ip:port
                $recipient = $selfInstance->getDhtInstance()->findNodeByIpPort($ipPort);
-               die(__METHOD__.':recipient=<pre>'.print_r($recipient, true).'</pre>' . PHP_EOL);
+               die(__METHOD__.':recipient=<pre>'.print_r($recipient, TRUE).'</pre>' . PHP_EOL);
 
                // Return result
                return $sessionId;
index dfaeb8a31d767652861da331da0662c5d986d3db..2f8d830cda176562b0a3e4de4e6ab67e401434f8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -159,7 +159,7 @@ final class ApplicationEntryPoint {
                        exit();
                } else {
                        // Output message and die
-                       exit(sprintf("[Main:] Emergency exit reached: <span class=\"emergency_span\">%s</span>",
+                       exit(sprintf('[Main:] Emergency exit reached: <span class="emergency_span">%s</span>',
                                $message
                        ));
                }
@@ -206,10 +206,10 @@ final class ApplicationEntryPoint {
 } // END - class
 
 // Developer mode active? Comment out if no dev!
-define('DEVELOPER', true);
+define('DEVELOPER', TRUE);
 
 // Log all exceptions (only debug! This option can create large error logs)
-//define('LOG_EXCEPTIONS', true);
+//define('LOG_EXCEPTIONS', TRUE);
 
 //xdebug_start_trace();