From df030ed5e35a394da292188307e40eb8d8779509 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 31 May 2013 20:04:14 +0000 Subject: [PATCH] Made lower to upper case: - NULL - FALSE - TRUE As they are constants, lower-case are keywords --- .../interfaces/apt-proxy/class_AptProxy.php | 2 +- .../hub/interfaces/chat/class_Chatter.php | 2 +- .../cruncher/class_CruncherHelper.php | 2 +- .../main/apt-proxy/class_BaseNodeAptProxy.php | 4 ++-- .../hub/main/chat/class_BaseNodeChat.php | 4 ++-- application/hub/main/class_BaseHubSystem.php | 6 ++--- .../main/cruncher/class_BaseHubCruncher.php | 4 ++-- .../socket/class_PackageSocketDiscovery.php | 4 ++-- .../class_AptProxyPhpRequirementsFilter.php | 6 ++--- .../chat/class_ChatPhpRequirementsFilter.php | 6 ++--- .../class_CruncherPhpRequirementsFilter.php | 6 ++--- .../node/class_NodePhpRequirementsFilter.php | 6 ++--- .../handler/chunks/class_ChunkHandler.php | 6 ++--- .../hub/main/handler/network/tcp/class_ | 2 +- .../network/tcp/class_TcpRawDataHandler.php | 4 ++-- .../main/handler/tasks/class_TaskHandler.php | 10 ++++----- .../connection/class_BaseConnectionHelper.php | 22 +++++++++---------- .../tcp/class_TcpConnectionHelper.php | 2 +- .../hub/main/listener/class_BaseListener.php | 4 ++-- application/hub/main/listener/tcp/class_ | 2 +- .../hub/main/nodes/class_BaseHubNode.php | 20 ++++++++--------- .../hub/main/package/class_NetworkPackage.php | 2 +- .../fragmenter/class_PackageFragmenter.php | 6 ++--- .../main/pools/peer/class_DefaultPeerPool.php | 2 +- .../connection/class_ConnectionRegistry.php | 2 +- .../registry/socket/class_SocketRegistry.php | 2 +- .../class_HubConsoleCommandResolver.php | 6 ++--- .../class_HubConsoleControllerResolver.php | 2 +- .../http/class_HubHttpControllerResolver.php | 2 +- .../state/class_BaseStateResolver.php | 6 ++--- index.php | 6 ++--- 31 files changed, 80 insertions(+), 80 deletions(-) diff --git a/application/hub/interfaces/apt-proxy/class_AptProxy.php b/application/hub/interfaces/apt-proxy/class_AptProxy.php index 935df79e3..644a36833 100644 --- a/application/hub/interfaces/apt-proxy/class_AptProxy.php +++ b/application/hub/interfaces/apt-proxy/class_AptProxy.php @@ -55,7 +55,7 @@ interface AptProxy extends FrameworkInterface { * @param $version Version number of this apt-proxy * @return void */ - function enableIsActive ($isActive = true); + function enableIsActive ($isActive = TRUE); /** * Determines whether the apt-proxy is active diff --git a/application/hub/interfaces/chat/class_Chatter.php b/application/hub/interfaces/chat/class_Chatter.php index 7e39a10ea..bbf10c1d7 100644 --- a/application/hub/interfaces/chat/class_Chatter.php +++ b/application/hub/interfaces/chat/class_Chatter.php @@ -55,7 +55,7 @@ interface Chatter extends FrameworkInterface { * @param $version Version number of this chatter * @return void */ - function enableIsActive ($isActive = true); + function enableIsActive ($isActive = TRUE); /** * Determines whether the chatter is active diff --git a/application/hub/interfaces/cruncher/class_CruncherHelper.php b/application/hub/interfaces/cruncher/class_CruncherHelper.php index 0c23d22ca..ba5c9b29e 100644 --- a/application/hub/interfaces/cruncher/class_CruncherHelper.php +++ b/application/hub/interfaces/cruncher/class_CruncherHelper.php @@ -64,7 +64,7 @@ interface CruncherHelper extends FrameworkInterface { * @param $version Version number of this cruncher * @return void */ - function enableIsActive ($isActive = true); + function enableIsActive ($isActive = TRUE); /** * Determines whether the cruncher is active diff --git a/application/hub/main/apt-proxy/class_BaseNodeAptProxy.php b/application/hub/main/apt-proxy/class_BaseNodeAptProxy.php index be1d3f5fc..c6b7abcfa 100644 --- a/application/hub/main/apt-proxy/class_BaseNodeAptProxy.php +++ b/application/hub/main/apt-proxy/class_BaseNodeAptProxy.php @@ -25,7 +25,7 @@ class BaseNodeAptProxy extends BaseHubSystem { /** * Whether this apt-proxy is active */ - private $isActive = false; + private $isActive = FALSE; /** * Protected constructor @@ -44,7 +44,7 @@ class BaseNodeAptProxy extends BaseHubSystem { * @param $version Version number of this apt-proxy * @return void */ - public final function enableIsActive ($isActive = true) { + public final function enableIsActive ($isActive = TRUE) { $this->isActive = (bool) $isActive; } diff --git a/application/hub/main/chat/class_BaseNodeChat.php b/application/hub/main/chat/class_BaseNodeChat.php index 2678bf1b0..e2b729c36 100644 --- a/application/hub/main/chat/class_BaseNodeChat.php +++ b/application/hub/main/chat/class_BaseNodeChat.php @@ -25,7 +25,7 @@ class BaseNodeChat extends BaseHubSystem { /** * Whether this Chatter is active */ - private $isActive = false; + private $isActive = FALSE; /** * Protected constructor @@ -44,7 +44,7 @@ class BaseNodeChat extends BaseHubSystem { * @param $version Version number of this chatter * @return void */ - public final function enableIsActive ($isActive = true) { + public final function enableIsActive ($isActive = TRUE) { $this->isActive = (bool) $isActive; } diff --git a/application/hub/main/class_BaseHubSystem.php b/application/hub/main/class_BaseHubSystem.php index b637cc339..6d34489d6 100644 --- a/application/hub/main/class_BaseHubSystem.php +++ b/application/hub/main/class_BaseHubSystem.php @@ -446,7 +446,7 @@ class BaseHubSystem extends BaseFrameworkSystem { */ protected function isValidFinalChunk (array $chunks) { // Default is all fine - $isValid = true; + $isValid = TRUE; // Split the (possible) EOP chunk $chunkSplits = explode(PackageFragmenter::CHUNK_DATA_HASH_SEPARATOR, $chunks[count($chunks) - 1]); @@ -458,10 +458,10 @@ class BaseHubSystem extends BaseFrameworkSystem { // Validate final chunk if (substr($chunkSplits[ChunkHandler::CHUNK_SPLITS_INDEX_RAW_DATA], 0, strlen(PackageFragmenter::END_OF_PACKAGE_IDENTIFIER)) != PackageFragmenter::END_OF_PACKAGE_IDENTIFIER) { // Not fine - $isValid = false; + $isValid = FALSE; } elseif (substr_count($chunkSplits[ChunkHandler::CHUNK_SPLITS_INDEX_RAW_DATA], PackageFragmenter::CHUNK_HASH_SEPARATOR) != 1) { // CHUNK_HASH_SEPARATOR shall only be found once - $isValid = false; + $isValid = FALSE; } // Return status diff --git a/application/hub/main/cruncher/class_BaseHubCruncher.php b/application/hub/main/cruncher/class_BaseHubCruncher.php index 9eab56368..d55ba6bef 100644 --- a/application/hub/main/cruncher/class_BaseHubCruncher.php +++ b/application/hub/main/cruncher/class_BaseHubCruncher.php @@ -30,7 +30,7 @@ abstract class BaseHubCruncher extends BaseHubSystem implements Updateable { /** * By default no cruncher is active */ - private $isActive = false; + private $isActive = FALSE; /** * All buffer queue instances (a FIFO) @@ -121,7 +121,7 @@ abstract class BaseHubCruncher extends BaseHubSystem implements Updateable { * @param $version Version number of this cruncher * @return void */ - public final function enableIsActive ($isActive = true) { + public final function enableIsActive ($isActive = TRUE) { $this->isActive = (bool) $isActive; } diff --git a/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php b/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php index 93f30ae30..9745185fc 100644 --- a/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php +++ b/application/hub/main/discovery/socket/class_PackageSocketDiscovery.php @@ -140,7 +140,7 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc } // 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)) { + if (($socketResource === FALSE) || (!is_resource($socketResource)) || (socket_last_error($socketResource) > 0)) { // Try to create a new socket resource try { // Possibly noisy debug message @@ -169,7 +169,7 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc 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; + $socketResource = FALSE; } // And return it diff --git a/application/hub/main/filter/apt-proxy/class_AptProxyPhpRequirementsFilter.php b/application/hub/main/filter/apt-proxy/class_AptProxyPhpRequirementsFilter.php index a8f192cf1..19e50c18c 100644 --- a/application/hub/main/filter/apt-proxy/class_AptProxyPhpRequirementsFilter.php +++ b/application/hub/main/filter/apt-proxy/class_AptProxyPhpRequirementsFilter.php @@ -56,18 +56,18 @@ class AptProxyPhpRequirementsFilter extends BaseAptProxyFilter implements Filter */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // By default, the requirement check is passed and zero checks are failed - $checkPassed = true; + $checkPassed = TRUE; $checksFailed = 0; // Socket support is essential... if (!function_exists('socket_create')) { // Test failed - $checkPassed = false; + $checkPassed = FALSE; $checksFailed++; } // END -if // Are all tests passed? - if ($checkPassed === false) { + if ($checkPassed === FALSE) { // Throw an exception throw new FilterChainException($this, self::FILTER_CHAIN_INTERCEPTED); } // END - if diff --git a/application/hub/main/filter/chat/class_ChatPhpRequirementsFilter.php b/application/hub/main/filter/chat/class_ChatPhpRequirementsFilter.php index ce2a04c00..493cff265 100644 --- a/application/hub/main/filter/chat/class_ChatPhpRequirementsFilter.php +++ b/application/hub/main/filter/chat/class_ChatPhpRequirementsFilter.php @@ -56,18 +56,18 @@ class ChatPhpRequirementsFilter extends BaseChatFilter implements Filterable { */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // By default, the requirement check is passed and zero checks are failed - $checkPassed = true; + $checkPassed = TRUE; $checksFailed = 0; // Socket support is essential... if (!function_exists('socket_create')) { // Test failed - $checkPassed = false; + $checkPassed = FALSE; $checksFailed++; } // END -if // Are all tests passed? - if ($checkPassed === false) { + if ($checkPassed === FALSE) { // Throw an exception throw new FilterChainException($this, self::FILTER_CHAIN_INTERCEPTED); } // END - if diff --git a/application/hub/main/filter/cruncher/class_CruncherPhpRequirementsFilter.php b/application/hub/main/filter/cruncher/class_CruncherPhpRequirementsFilter.php index cbafdd088..1d79e46ac 100644 --- a/application/hub/main/filter/cruncher/class_CruncherPhpRequirementsFilter.php +++ b/application/hub/main/filter/cruncher/class_CruncherPhpRequirementsFilter.php @@ -56,18 +56,18 @@ class CruncherPhpRequirementsFilter extends BaseCruncherFilter implements Filter */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // By default, the requirement check is passed and zero checks are failed - $checkPassed = true; + $checkPassed = TRUE; $checksFailed = 0; // Socket support is essential... if (!function_exists('socket_create')) { // Test failed - $checkPassed = false; + $checkPassed = FALSE; $checksFailed++; } // END -if // Are all tests passed? - if ($checkPassed === false) { + if ($checkPassed === FALSE) { // Throw an exception throw new FilterChainException($this, self::FILTER_CHAIN_INTERCEPTED); } // END - if diff --git a/application/hub/main/filter/node/class_NodePhpRequirementsFilter.php b/application/hub/main/filter/node/class_NodePhpRequirementsFilter.php index f905e2355..d88bef622 100644 --- a/application/hub/main/filter/node/class_NodePhpRequirementsFilter.php +++ b/application/hub/main/filter/node/class_NodePhpRequirementsFilter.php @@ -56,18 +56,18 @@ class NodePhpRequirementsFilter extends BaseNodeFilter implements Filterable { */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // By default, the requirement check is passed and zero checks are failed - $checkPassed = true; + $checkPassed = TRUE; $checksFailed = 0; // Socket support is essential... if (!function_exists('socket_create')) { // Test failed - $checkPassed = false; + $checkPassed = FALSE; $checksFailed++; } // END -if // Are all tests passed? - if ($checkPassed === false) { + if ($checkPassed === FALSE) { // Throw an exception throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); } // END - if diff --git a/application/hub/main/handler/chunks/class_ChunkHandler.php b/application/hub/main/handler/chunks/class_ChunkHandler.php index 1f3506797..03f514957 100644 --- a/application/hub/main/handler/chunks/class_ChunkHandler.php +++ b/application/hub/main/handler/chunks/class_ChunkHandler.php @@ -215,7 +215,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable * As for now, just set the array element. If any further steps are * being added, this should always be the last step. */ - $this->finalPackageChunks['is_complete'] = true; + $this->finalPackageChunks['is_complete'] = TRUE; } /** @@ -401,7 +401,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable */ public function ifUnhandledChunksWithFinalAvailable () { // Simply check if the stacker is not empty - $unhandledChunks = $this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP) === false; + $unhandledChunks = $this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP) === FALSE; // Return result return $unhandledChunks; @@ -480,7 +480,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable */ public function ifUnassembledChunksAvailable () { // For now do only check the array element 'is_complete' - $unassembledChunksAvailable = ($this->finalPackageChunks['is_complete'] === true); + $unassembledChunksAvailable = ($this->finalPackageChunks['is_complete'] === TRUE); // Return status return $unassembledChunksAvailable; diff --git a/application/hub/main/handler/network/tcp/class_ b/application/hub/main/handler/network/tcp/class_ index 512976016..9324cf1fc 100644 --- a/application/hub/main/handler/network/tcp/class_ +++ b/application/hub/main/handler/network/tcp/class_ @@ -46,7 +46,7 @@ while (count($clients) > 0) { $data = @socket_read($read_sock, 1024, PHP_NORMAL_READ); // check if the client is disconnected - if (($data === false) || (in_array(strtolower(trim($data)), $leaving))) { + if (($data === FALSE) || (in_array(strtolower(trim($data)), $leaving))) { // remove client for $clients array $key = array_search($read_sock, $clients); diff --git a/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php b/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php index fc9c94f91..7b711232c 100644 --- a/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php +++ b/application/hub/main/handler/network/tcp/class_TcpRawDataHandler.php @@ -77,7 +77,7 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { // Debug output of read data length //* 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); + //* 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) { @@ -93,7 +93,7 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { // Skip any further processing return; - } elseif (($rawData === false) || (socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]) > 0)) { + } elseif (($rawData === FALSE) || (socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE]) > 0)) { // Network error or connection lost $this->setErrorCode(socket_last_error($socketArray[BasePool::SOCKET_ARRAY_RESOURCE])); } elseif (empty($rawData)) { diff --git a/application/hub/main/handler/tasks/class_TaskHandler.php b/application/hub/main/handler/tasks/class_TaskHandler.php index d09646d85..271a0a9c6 100644 --- a/application/hub/main/handler/tasks/class_TaskHandler.php +++ b/application/hub/main/handler/tasks/class_TaskHandler.php @@ -80,7 +80,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { */ private function executeCurrentTask () { // Update no task by default - $updateTask = false; + $updateTask = FALSE; // Is the current task valid? if (!$this->getListInstance()->getIterator()->valid()) { @@ -92,7 +92,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $currentTask = $this->getListInstance()->getIterator()->current(); // Is the task not yet started? - if ($currentTask['task_started'] === false) { + if ($currentTask['task_started'] === FALSE) { // Determine difference between current time and registration $diff = ($this->getMilliTime() - $currentTask['task_registered']) * 1000; @@ -103,8 +103,8 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { } // END - if // Launch the task and mark it as updated - $currentTask['task_started'] = true; - $updateTask = true; + $currentTask['task_started'] = TRUE; + $updateTask = TRUE; // Debug message self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __LINE__ . ']: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms'); @@ -116,7 +116,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { // Is the interval delay reached? if ((($diff < $currentTask['task_interval_delay']) && ($currentTask['task_max_runs'] == 0)) || (($currentTask['task_total_runs'] == $currentTask['task_max_runs']) && ($currentTask['task_max_runs'] > 0))) { // Should we update the task from startup? - if ($updateTask === true) { + if ($updateTask === TRUE) { // Update the task before leaving $this->updateTask($currentTask); } // END - if diff --git a/application/hub/main/helper/connection/class_BaseConnectionHelper.php b/application/hub/main/helper/connection/class_BaseConnectionHelper.php index efe7bbc88..c41d22eb4 100644 --- a/application/hub/main/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/main/helper/connection/class_BaseConnectionHelper.php @@ -68,12 +68,12 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, /** * Whether this connection is initialized */ - private $isInitialized = false; + private $isInitialized = FALSE; /** * Whether this connection is shutted down */ - private $shuttedDown = false; + private $shuttedDown = FALSE; /** * Currently queued chunks @@ -218,7 +218,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, } // END - if // Last step: mark connection as initialized - $this->isInitialized = true; + $this->isInitialized = TRUE; } /** @@ -232,7 +232,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, */ protected function connectToPeerByRecipientData (array $recipientData) { // Only call this if the connection is initialized by initConnection() - assert($this->isInitialized === true); + assert($this->isInitialized === TRUE); // Get current time $time = time(); @@ -254,7 +254,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Now, is that attempt within parameters? if ((time() - $time) >= $timeout) { // Didn't work within timeout - $isConnected = false; + $isConnected = FALSE; break; } // END - if @@ -262,13 +262,13 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $this->idle(1000); } elseif ($socketError != 0) { // Stop on everything else pronto - $isConnected = false; + $isConnected = FALSE; break; } } // END - while // Is the peer connected? - if ($isConnected === true) { + if ($isConnected === TRUE) { // Connection is fully established here, so change the state. PeerStateFactory::createPeerStateInstanceByName('connected', $this); } else { @@ -330,7 +330,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, private function getRawDataFromPackageArray (array $packageData) { // Implode the package data array and fragement the resulting string, returns the final hash $finalHash = $this->getFragmenterInstance()->fragmentPackageArray($packageData, $this); - if ($finalHash !== true) { + if ($finalHash !== TRUE) { $this->currentFinalHash = $finalHash; } // END - if @@ -421,7 +421,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $sentBytes = 0; // Deliver all data - while ($sentBytes !== false) { + while ($sentBytes !== FALSE) { // And deliver it //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Sending out ' . strlen($encodedData) . ' bytes,bufferSize=' . $bufferSize . ',diff=' . $this->diff); @@ -436,7 +436,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, } // If there was an error, we don't continue here - if ($sentBytes === false) { + if ($sentBytes === FALSE) { // Handle the error with a faked recipientData array $this->handleSocketError(__METHOD__, __LINE__, $socketResource, array('0.0.0.0', '0')); @@ -481,7 +481,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, */ protected final function markConnectionShuttedDown () { //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: ' . $this->__toString() . ' has been marked as shutted down'); - $this->shuttedDown = true; + $this->shuttedDown = TRUE; // And remove the (now invalid) socket $this->setSocketResource(false); diff --git a/application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php b/application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php index 0fbfee373..23ba71baf 100644 --- a/application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php +++ b/application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php @@ -101,7 +101,7 @@ class TcpConnectionHelper extends BaseConnectionHelper implements ConnectionHelp $recipientData[0] = ConsoleTools::determineExternalIp(); // Do we have hostname:ip match? - if (strpos($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], ':') === false) { + if (strpos($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], ':') === FALSE) { // No hostname:ip! $helperInstance->debugInstance($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] . ' does not contain ":". Please fix this.'); } // END - if diff --git a/application/hub/main/listener/class_BaseListener.php b/application/hub/main/listener/class_BaseListener.php index 6651198a5..250081235 100644 --- a/application/hub/main/listener/class_BaseListener.php +++ b/application/hub/main/listener/class_BaseListener.php @@ -51,7 +51,7 @@ class BaseListener extends BaseHubSystem implements Visitable { /** * Whether we are in blocking or non-blocking mode (default: non-blocking */ - private $blockingMode = false; + private $blockingMode = FALSE; /** * A peer pool instance @@ -80,7 +80,7 @@ class BaseListener extends BaseHubSystem implements Visitable { $isServerSocket = ((is_resource($socketResource)) && (!@socket_getpeername($socketResource, $peerName))); // We need to clear the error here if it is a resource - if ($isServerSocket === true) { + if ($isServerSocket === TRUE) { // Clear the error //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('socketResource[]=' . gettype($socketResource)); socket_clear_error($socketResource); diff --git a/application/hub/main/listener/tcp/class_ b/application/hub/main/listener/tcp/class_ index 512976016..9324cf1fc 100644 --- a/application/hub/main/listener/tcp/class_ +++ b/application/hub/main/listener/tcp/class_ @@ -46,7 +46,7 @@ while (count($clients) > 0) { $data = @socket_read($read_sock, 1024, PHP_NORMAL_READ); // check if the client is disconnected - if (($data === false) || (in_array(strtolower(trim($data)), $leaving))) { + if (($data === FALSE) || (in_array(strtolower(trim($data)), $leaving))) { // remove client for $clients array $key = array_search($read_sock, $clients); diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index e1b3681a8..1b052c5b9 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -55,17 +55,17 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { * Whether this node is anncounced (KEEP ON false!) * @deprecated */ - private $hubIsAnnounced = false; + private $hubIsAnnounced = FALSE; /** * Whether this hub is active (default: false) */ - private $isActive = false; + private $isActive = FALSE; /** * Whether this node accepts announcements (default: false) */ - private $acceptAnnouncements = false; + private $acceptAnnouncements = FALSE; /** * Protected constructor @@ -207,7 +207,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ protected function ifAddressMatchesBootstrappingNodes ($remoteAddr) { // By default nothing is found - $isFound = false; + $isFound = FALSE; // Run through all configured IPs foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $ipPort) { @@ -217,7 +217,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { // Does it match? if ($ipPortArray[0] == $remoteAddr) { // Found it! - $isFound = true; + $isFound = TRUE; // Remember the port number $this->bootIpPort = $ipPort; @@ -232,7 +232,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { * IP matches listen address. At this point we really don't care * if we can really listen on that address */ - $isFound = true; + $isFound = TRUE; // Remember the port number $this->bootIpPort = $ipPort; @@ -453,7 +453,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ public function announceToUpperNodes (Taskable $taskInstance) { // Is this hub node announced? - if ($this->hubIsAnnounced === true) { + if ($this->hubIsAnnounced === TRUE) { // Already announced! throw new NodeAlreadyAnnouncedException($this, self::EXCEPTION_HUB_ALREADY_ANNOUNCED); } // END - if @@ -621,7 +621,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { * @param $isActive Whether the hub is active * @return void */ - public final function enableIsActive ($isActive = true) { + public final function enableIsActive ($isActive = TRUE) { $this->isActive = (bool) $isActive; } @@ -632,7 +632,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { */ public final function isAcceptingAnnouncements () { // Check it (this node must be active and not shutdown!) - $acceptAnnouncements = (($this->acceptAnnouncements === true) && ($this->isNodeActive())); + $acceptAnnouncements = (($this->acceptAnnouncements === TRUE) && ($this->isNodeActive())); // Return it return $acceptAnnouncements; @@ -684,7 +684,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable, AddableCriteria { * @param $acceptAnnouncements Whether this node accepts announcements (default: true) * @return void */ - protected final function enableAcceptingAnnouncements ($acceptAnnouncements = true) { + protected final function enableAcceptingAnnouncements ($acceptAnnouncements = TRUE) { $this->acceptAnnouncements = $acceptAnnouncements; } diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index 898eb798c..820288276 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -280,7 +280,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R * @param $forceReInit Whether to force reinitialization of all stacks * @return void */ - protected function initStackers ($forceReInit = false) { + protected function initStackers ($forceReInit = FALSE) { // Initialize all foreach ( array( diff --git a/application/hub/main/package/fragmenter/class_PackageFragmenter.php b/application/hub/main/package/fragmenter/class_PackageFragmenter.php index 7214942cf..519537af5 100644 --- a/application/hub/main/package/fragmenter/class_PackageFragmenter.php +++ b/application/hub/main/package/fragmenter/class_PackageFragmenter.php @@ -178,7 +178,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera $isProcessed = ( (isset($this->processedPackages[$index])) && - ($this->processedPackages[$index] === true) + ($this->processedPackages[$index] === TRUE) ); // Return it @@ -193,7 +193,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera */ private function markPackageDataProcessed (array $packageData) { // Remember it (until we may remove it) - $this->processedPackages[$this->getProcessedPackagesIndex($packageData)] = true; + $this->processedPackages[$this->getProcessedPackagesIndex($packageData)] = TRUE; } /** @@ -491,7 +491,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera $current = $this->getCurrentChunkPointer($finalHash); } catch (AssertionException $e) { // This may happen when the final hash is true - if ($finalHash === true) { + if ($finalHash === TRUE) { // Set current to null $current = NULL; } else { diff --git a/application/hub/main/pools/peer/class_DefaultPeerPool.php b/application/hub/main/pools/peer/class_DefaultPeerPool.php index c7ee45d91..f872b76aa 100644 --- a/application/hub/main/pools/peer/class_DefaultPeerPool.php +++ b/application/hub/main/pools/peer/class_DefaultPeerPool.php @@ -218,7 +218,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { */ public function getSocketFromPackageData (array $packageData, $connectionType = NULL) { // Default is no socket - $socketResource = false; + $socketResource = FALSE; // Temporary resolve recipient field $recipientIpArray = explode(':', HubTools::resolveSessionId($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])); diff --git a/application/hub/main/registry/connection/class_ConnectionRegistry.php b/application/hub/main/registry/connection/class_ConnectionRegistry.php index cf144a95d..4c786b3f9 100644 --- a/application/hub/main/registry/connection/class_ConnectionRegistry.php +++ b/application/hub/main/registry/connection/class_ConnectionRegistry.php @@ -116,7 +116,7 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC */ public function isConnectionRegistered (ConnectionHelper $connectionInstance, $socketResource) { // Default is not registered - $isRegistered = false; + $isRegistered = FALSE; // First, check for the instance, there can be only once if ($this->isProtocolRegistered($connectionInstance)) { diff --git a/application/hub/main/registry/socket/class_SocketRegistry.php b/application/hub/main/registry/socket/class_SocketRegistry.php index a293fb06c..b75c78204 100644 --- a/application/hub/main/registry/socket/class_SocketRegistry.php +++ b/application/hub/main/registry/socket/class_SocketRegistry.php @@ -142,7 +142,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - ENTERED!'); // Default is not registered - $isRegistered = false; + $isRegistered = FALSE; // First, check for the instance, there can be only once if ($this->isProtocolRegistered($protocolInstance)) { diff --git a/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php b/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php index 7bb7c5394..199f1251f 100644 --- a/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php +++ b/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php @@ -52,7 +52,7 @@ class HubConsoleCommandResolver extends BaseCommandResolver implements CommandRe if (empty($commandName)) { // Then thrown an exception here throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif ($resolverInstance->isCommandValid($commandName) === false) { + } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) { // Invalid command found throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND); } @@ -87,7 +87,7 @@ class HubConsoleCommandResolver extends BaseCommandResolver implements CommandRe if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_console_command'); // Check if command is valid - if ($this->isCommandValid($commandName) === false) { + if ($this->isCommandValid($commandName) === FALSE) { // This command is invalid! throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); } // END - if @@ -123,7 +123,7 @@ class HubConsoleCommandResolver extends BaseCommandResolver implements CommandRe if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_console_command'); // Check if command is valid - if ($this->isCommandValid($commandName) === false) { + if ($this->isCommandValid($commandName) === FALSE) { // This command is invalid! throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); } diff --git a/application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php b/application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php index 2726ef33b..f6f29e2af 100644 --- a/application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php +++ b/application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php @@ -52,7 +52,7 @@ class HubConsoleControllerResolver extends BaseControllerResolver implements Con if (empty($controllerName)) { // Then thrown an exception here throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif ($resolverInstance->isControllerValid($controllerName) === false) { + } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) { // Invalid command found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); } diff --git a/application/hub/main/resolver/controller/http/class_HubHttpControllerResolver.php b/application/hub/main/resolver/controller/http/class_HubHttpControllerResolver.php index 8dfc4f58b..cba643e25 100644 --- a/application/hub/main/resolver/controller/http/class_HubHttpControllerResolver.php +++ b/application/hub/main/resolver/controller/http/class_HubHttpControllerResolver.php @@ -62,7 +62,7 @@ class HubHttpControllerResolver extends BaseControllerResolver implements Contro if (empty($controllerName)) { // Then thrown an exception here throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif ($resolverInstance->isControllerValid($controllerName) === false) { + } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) { // Invalid command found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); } diff --git a/application/hub/main/resolver/state/class_BaseStateResolver.php b/application/hub/main/resolver/state/class_BaseStateResolver.php index 97995e271..6ce89ebc3 100644 --- a/application/hub/main/resolver/state/class_BaseStateResolver.php +++ b/application/hub/main/resolver/state/class_BaseStateResolver.php @@ -127,7 +127,7 @@ class BaseStateResolver extends BaseResolver { */ public function isStateValid ($stateName) { // By default nothing shall be valid - $isValid = false; + $isValid = FALSE; // Is a state set? if (empty($stateName)) { @@ -142,11 +142,11 @@ class BaseStateResolver extends BaseResolver { $this->setClassName($className); // Try it hard to get an state - while ($isValid === false) { + while ($isValid === FALSE) { // Is this class already loaded? if (class_exists($this->getClassName())) { // This class does exist. :-) - $isValid = true; + $isValid = TRUE; } elseif ($this->getClassName() != $this->statePrefix . 'DefaultState') { // Set default state $this->setClassName($this->statePrefix . 'DefaultState'); diff --git a/index.php b/index.php index 1202b317f..dfaeb8a31 100644 --- a/index.php +++ b/index.php @@ -42,7 +42,7 @@ final class ApplicationEntryPoint { * @return void * @todo This method is old code and needs heavy rewrite and should be moved to ApplicationHelper */ - public static final function app_exit ($message = '', $code = false, $extraData = '', $silentMode = false) { + public static final function app_exit ($message = '', $code = FALSE, $extraData = '', $silentMode = FALSE) { // Is this method already called? if (isset($GLOBALS['app_die_called'])) { // Then output the text directly @@ -50,7 +50,7 @@ final class ApplicationEntryPoint { } // END - if // This method shall not be called twice - $GLOBALS['app_die_called'] = true; + $GLOBALS['app_die_called'] = TRUE; // Is a message set? if (empty($message)) { @@ -62,7 +62,7 @@ final class ApplicationEntryPoint { $configInstance = FrameworkConfiguration::getSelfInstance(); // Do we have debug installation? - if (($configInstance->getConfigEntry('product_install_mode') == 'productive') || ($silentMode === true)) { + if (($configInstance->getConfigEntry('product_install_mode') == 'productive') || ($silentMode === TRUE)) { // Abort here exit(); } // END - if -- 2.39.2