]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/tools/console/class_ConsoleTools.php
Renamed Registry -> GenericRegistry to make it clear that this registry does
[core.git] / framework / main / classes / tools / console / class_ConsoleTools.php
index 8b5a2a456295a3b6d7e0bd53297afca3bf1f6161..feafde705c0702c1ee0375fd07b0189fc29b29cc 100644 (file)
@@ -1,14 +1,17 @@
 <?php
 // Own namespace
-namespace CoreFramework\Console\Tools;
+namespace Org\Mxchange\CoreFramework\Console\Tools;
 
 // Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
-use CoreFramework\Factory\ObjectFactory;
-use CoreFramework\Filesystem\FileNotFoundException;
-use CoreFramework\Generic\FrameworkException;
-use CoreFramework\Object\BaseFrameworkSystem;
-use CoreFramework\Socket\InvalidSocketException;
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkException;
+use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
+use Org\Mxchange\CoreFramework\Socket\InvalidSocketException;
+
+// Import SPL stuff
+use \SplFileInfo;
 
 /**
  * This class contains static helper functions for console applications
@@ -52,7 +55,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                parent::__construct(__CLASS__);
 
                // Cache configuration entry
-               self::$quietResolver = FrameworkConfiguration::getSelfInstance()->getConfigEntry('quiet_dns_resolver');
+               self::$quietResolver = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('quiet_dns_resolver');
        }
 
        /**
@@ -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;
        }