X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fconsole%2Fclass_ConsoleTools.php;h=0d269417f53539e02828be09dea0366416c9675a;hp=98d6ec4b53f7cffbcc4564d23357741078b8b222;hb=d26e71af1e28dc1429823bdec244df6303f9b2fb;hpb=45787c502470b6d33071987db93082cca997329e diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php index 98d6ec4b..0d269417 100644 --- a/inc/classes/main/console/class_ConsoleTools.php +++ b/inc/classes/main/console/class_ConsoleTools.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -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); @@ -253,7 +253,7 @@ class ConsoleTools extends BaseFrameworkSystem { /** * Determines own remote IP address (e.g. can be used to probe if we are - * reachable from outside by determining external IP and then connect to it. + * reachable from outside by determining external address and then connect to it. * This is accomblished by connecting to the IP of www.shipsimu.org which * should default to 188.138.90.169 and requesting /ip.php which does only * return the content of $_SERVER['REMOTE_ADDR']. Of course, this method @@ -263,12 +263,12 @@ class ConsoleTools extends BaseFrameworkSystem { * Compare to following link: * http://de.php.net/manual/en/function.socket-create.php#49368 * - * @return $externalAddress The determined external IP address + * @return $externalAddress The determined external address address * @throws InvalidSocketException If socket initialization wents wrong or if an errors occurs * @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(); @@ -345,7 +345,7 @@ class ConsoleTools extends BaseFrameworkSystem { // Debug message /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONSOLE-TOOLS[' . __METHOD__ . ':' . __LINE__ . ']: Resolved external address: ' . $externalAddress); - // Return determined external IP + // Return determined external address return $externalAddress; }