From: Roland Häder Date: Fri, 1 May 2009 08:46:26 +0000 (+0000) Subject: News/README updated, misc fixes to BaseHubNode class X-Git-Url: https://git.mxchange.org/?p=hub.git;a=commitdiff_plain;h=5b7e1278fb05c1a86533d65fa24557a6f94dd216 News/README updated, misc fixes to BaseHubNode class --- diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index c0dfac164..03f8f5052 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -78,8 +78,11 @@ class BaseHubNode extends BaseFrameworkSystem implements Updateable { // Run through all configured IPs foreach (explode(',', $this->getConfigInstance()->readConfig('hub_bootstrap_nodes')) as $ipPort) { + // Split it up in IP/port + $ipPortArray = explode(':', $ipPort); + // Does it match? - if (substr($ipPort, 0, strlen($remoteAddr)) == $remoteAddr) { + if ($ipPortArray[0] == $remoteAddr) { // Found it! $isFound = true; @@ -91,7 +94,7 @@ class BaseHubNode extends BaseFrameworkSystem implements Updateable { // Stop further searching break; - } elseif (substr($ipPort, 0, strlen($this->getConfigInstance()->readConfig('node_listen_addr'))) == $this->getConfigInstance()->readConfig('node_listen_addr')) { + } elseif ($ipPortArray[0] == $this->getConfigInstance()->readConfig('node_listen_addr')) { // IP matches listen address. At this point we really don't care // if we can also listen on that address! $isFound = true; diff --git a/docs/NEWS b/docs/NEWS index b41180a2f..c4eb118ad 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -1,5 +1,13 @@ -NEWS -==== +NEWS / ChangeLog +================ + +[2009-04-30] +------------ +- Detection of own IP address fixed (but might still be rewritten) +- Boot-node code moved from NaseHubNode class to its own class (cleanup) +- FileNotFoundException in ConsoleTools was caught without any console + ouput which is not recommended. +- README updated to reflect changes in some revisions ago [2009-03-30] ------------ @@ -27,7 +35,7 @@ Links to used software: ArgoUML (SVN checkout): http://argouml.tigris.org -FreeMind: +FreeMind: ("unoffical" but newer packages) http://freemind.sourceforget.net OpenOffice: diff --git a/docs/README b/docs/README index 8639c614e..5a8950ed8 100644 --- a/docs/README +++ b/docs/README @@ -41,6 +41,7 @@ mode=master - A master-node holds a list of known nodes and which types of 2.) Current development notices: -------------------------------------------------------------------------------- -These modes are currently not yet finished. If you try an invalid out you may -get an exception called 'ClassNotFoundException' which has to be rewritten to -test if the mode is valid and output a nicer message to the user. +These modes are currently not yet finished. If you try an invalid out you now +get a nice and muich smaller error message. We still need to add a 'help' +command-line parameter and many more. This should be done with a nice helper +class and not just 'hey, my code runs' code. diff --git a/index.php b/index.php index 3945af962..b77289f9a 100644 --- a/index.php +++ b/index.php @@ -60,7 +60,7 @@ final class ApplicationEntryPoint { * @param $silentMode Wether not silent mode is turned on * @return void */ - public static function app_die ($message = "", $code = false, $extraData = "", $silentMode = false) { + public static function app_die ($message = '', $code = false, $extraData = '', $silentMode = false) { // Is this method already called? if (defined('EMERGENCY_EXIT_CALLED')) { // Then output the text directly @@ -73,14 +73,14 @@ final class ApplicationEntryPoint { // Is a message set? if (empty($message)) { // No message provided - $message = "No message provided!"; + $message = 'No message provided!'; } // END - if // Get config instance $configInstance = FrameworkConfiguration::getInstance(); // Do we have debug installation? - if (($configInstance->readConfig('product_install_mode') == "productive") || ($silentMode === true)) { + if (($configInstance->readConfig('product_install_mode') == 'productive') || ($silentMode === true)) { // Abort here die(); } // END - if @@ -106,7 +106,7 @@ final class ApplicationEntryPoint { // Get and prepare backtrace for output $backtraceArray = debug_backtrace(); - $backtrace = ""; + $backtrace = ''; foreach ($backtraceArray as $key => $trace) { if (!isset($trace['file'])) $trace['file'] = __FILE__; if (!isset($trace['line'])) $trace['line'] = __LINE__; @@ -161,7 +161,7 @@ final class ApplicationEntryPoint { } /** - * Determines the correct absolute path for all include + * Determines the correct absolute path for all includes * * @return $basePath Base path (core) for all includes */ diff --git a/package.sh b/package.sh index 25bf0b4d6..c7d12c053 100755 --- a/package.sh +++ b/package.sh @@ -3,14 +3,14 @@ sh ./clear-cache.sh echo -n "$0: Packaging... " -zip -9 shipsimu-hub_dev.zip docs/* Doxyfile *.php *.sh > /dev/null 2>&1 +zip -9 gos-hub_dev.zip docs/* Doxyfile *.php *.sh > /dev/null 2>&1 echo -n "." -zip -9r shipsimu-hub_dev.zip application/ db/ devel/ Doxyfile inc/ templates/ tests/ > /dev/null 2>&1 +zip -9r gos-hub_dev.zip application/ db/ devel/ Doxyfile inc/ templates/ tests/ > /dev/null 2>&1 echo -n "." -zip -d shipsimu-hub_dev.zip docs/warn.log db/*/*.serialized > /dev/null 2>&1 +zip -d gos-hub_dev.zip docs/warn.log db/*/*.serialized > /dev/null 2>&1 echo ". done" echo "$0: Renaming..." -mv shipsimu-hub_dev.zip shipsimu-hub_dev_`date +%Y%m%d_%H%M%S`.zip +mv gos-hub_dev.zip gos-hub_dev_`date +%Y%m%d_%H%M%S`.zip echo "$0: All done."