+
+ /**
+ * Determine IP or 'external_ip' if set
+ *
+ * @return $ip The determined external ip of this node
+ */
+ public static function determineOwnExternalIp () {
+ // Is the external_ip config entry set?
+ if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('external_ip') != '') {
+ // Use it as external ip
+ $ip = FrameworkConfiguration::getSelfInstance()->getConfigEntry('external_ip');
+ } else {
+ // Determine own external ip by connecting to my (coder) server at 188.138.90.169
+ $ip = ConsoleTools::determineExternalIp();
+ }
+
+ // Return it
+ return $ip;
+ }
+
+ /**
+ * Determine IP or 'internal_ip' if set
+ *
+ * @return $ip The determined external ip of this node
+ */
+ public static function determineOwnInternalIp () {
+ // Is the internal_ip config entry set?
+ if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('allow_publish_internal_ip') == 'N') {
+ // Not allowed to publish internal IP, so use external
+ $ip = self::determineOwnExternalIp();
+ } elseif (FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_ip') != '') {
+ // Use it as internal ip
+ $ip = FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_ip');
+ } else {
+ // Determine own internal ip by connecting to my (coder) server at 188.138.90.169
+ $ip = ConsoleTools::acquireSelfIPAddress();
+ }
+
+ // Return it
+ return $ip;
+ }