]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/tools/console/class_ConsoleTools.php
Rewritten:
[core.git] / framework / main / classes / tools / console / class_ConsoleTools.php
index 8b5a2a456295a3b6d7e0bd53297afca3bf1f6161..d730677cac1be44d8da8a50bb31d66f5daa58ff2 100644 (file)
@@ -10,6 +10,9 @@ use CoreFramework\Generic\FrameworkException;
 use CoreFramework\Object\BaseFrameworkSystem;
 use CoreFramework\Socket\InvalidSocketException;
 
+// Import SPL stuff
+use \SplFileInfo;
+
 /**
  * This class contains static helper functions for console applications
  *
@@ -242,9 +245,12 @@ class ConsoleTools extends BaseFrameworkSystem {
                // Get a new instance
                $helperInstance = new ConsoleTools();
 
+               // Get SplFileInfo instance
+               $infoInstance = new SplFileInfo($helperInstance->getConfigInstance()->getConfigEntry('hostname_file'));
+
                try {
                        // Get a file pointer
-                       $fileInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_class', array($helperInstance->getConfigInstance()->getConfigEntry('hostname_file')));
+                       $fileInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_class', array($infoInstance));
 
                        // Read the file
                        $rawData = trim($fileInstance->readFromFile());
@@ -281,9 +287,6 @@ class ConsoleTools extends BaseFrameworkSystem {
                        ));
                }
 
-               // Set it in configuration
-               FrameworkConfiguration::getSelfInstance()->setServerAddress($ipAddress);
-
                // Return it
                return $ipAddress;
        }