No longer simple IPs, better is UNL: Universal Node Locator
[core.git] / inc / classes / main / console / class_ConsoleTools.php
index 3f31de68ce28b706a670cb543568075f53799506..b7807d30010a2b5d63c33e27da3c00fa5951832a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -123,7 +123,7 @@ class ConsoleTools extends BaseFrameworkSystem {
 
                // Add last new-line
                $proxyTunnel .= self::HTTP_EOL;
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONSOLE-TOOLS[' . __LINE__ . ']: proxyTunnel=' . $proxyTunnel);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONSOLE-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: proxyTunnel=' . $proxyTunnel);
 
                // Write request
                fwrite($socketResource, $proxyTunnel);
@@ -207,13 +207,13 @@ class ConsoleTools extends BaseFrameworkSystem {
 
                try {
                        // Get a file pointer
-                       $io = FrameworkFileInputPointer::createFrameworkFileInputPointer($helperInstance->getConfigInstance()->getConfigEntry('hostname_file'));
+                       $fileInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_class', array($helperInstance->getConfigInstance()->getConfigEntry('hostname_file')));
 
                        // Read the file
-                       $rawData = trim($io->readFromFile());
+                       $rawData = trim($fileInstance->readFromFile());
 
                        // Close the file
-                       $io->closeFile();
+                       $fileInstance->closeFile();
 
                        // Extract hostname from it
                        $hostname = $helperInstance->extractHostnameFromRawData($rawData);
@@ -268,7 +268,7 @@ class ConsoleTools extends BaseFrameworkSystem {
         * @todo        This should be moved out to an external class, e.g. HttpClient
         * @todo        Make IP, host name, port and script name configurable
         */
-       public static function determineExternalIp () {
+       public static function determineExternalAddress () {
                // Get helper instance
                $helperInstance = new ConsoleTools();
 
@@ -343,7 +343,7 @@ class ConsoleTools extends BaseFrameworkSystem {
 
 
                // Debug message
-               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONSOLE-TOOLS[' . __LINE__ . ']: Resolved external address: ' . $externalAddress);
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONSOLE-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Resolved external address: ' . $externalAddress);
 
                // Return determined external IP
                return $externalAddress;