X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Ftools%2Fconsole%2Fclass_ConsoleTools.php;h=a5d50ba2a97d05365ad558d6f48bf71b4bd29a27;hb=24814f48bc7bad92f55e8763bf3f657fb41b131d;hp=902164101a779b964a6c605c5c9bd158981da47b;hpb=5da8f717122568335b8a8ab230fa0de17e983fab;p=core.git diff --git a/framework/main/classes/tools/console/class_ConsoleTools.php b/framework/main/classes/tools/console/class_ConsoleTools.php index 90216410..a5d50ba2 100644 --- a/framework/main/classes/tools/console/class_ConsoleTools.php +++ b/framework/main/classes/tools/console/class_ConsoleTools.php @@ -3,13 +3,16 @@ namespace CoreFramework\Console\Tools; // Import framework stuff -use CoreFramework\Configuration\FrameworkConfiguration; +use CoreFramework\Bootstrap\FrameworkBootstrap; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Filesystem\FileNotFoundException; 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 * @@ -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());