From: Roland Haeder Date: Sat, 25 Feb 2017 15:37:56 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3c2ae04e5adf3b903b6fa7f2b62ef241987a739f;p=core.git Continued: - tests may later have filters but now let's not focus on it - added "import" of BaseFactory - added "import" of HtmlNewsFactory - added "import" of ReadableNews - added config entry news_reader_main_class Signed-off-by: Roland Häder --- diff --git a/application/tests/classes/commands/console/class_TestsConsoleMainCommand.php b/application/tests/classes/commands/console/class_TestsConsoleMainCommand.php index d0c6657d..66c8147b 100644 --- a/application/tests/classes/commands/console/class_TestsConsoleMainCommand.php +++ b/application/tests/classes/commands/console/class_TestsConsoleMainCommand.php @@ -83,30 +83,13 @@ class TestsConsoleMainCommand extends BaseCommand implements Commandable { * @param $controllerInstance A controller instance * @param $requestInstance An instance of a class with an Requestable interface * @return void - * @todo Should we add some more filters? */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // @TODO Unfinished + return; + // Add pre filters $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_php_requirements_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_initializer_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_welcome_teaser_filter')); - - // Add bootstrap filters - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_nodeid_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_sessionid_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_private_key_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_extra_bootstrapping_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_listener_pool_filter')); - - // Add node activation filters - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_task_handler_initializer_filter')); - - // Add shutdown filters - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_flush_node_list_filter')); - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_task_handler_filter')); - - // This is the last generic shutdown filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_node_filter')); } } diff --git a/application/tests/classes/resolver/command/console/class_TestsConsoleCommandResolver.php b/application/tests/classes/resolver/command/console/class_TestsConsoleCommandResolver.php index 6b2ca23e..d7dfd9f6 100644 --- a/application/tests/classes/resolver/command/console/class_TestsConsoleCommandResolver.php +++ b/application/tests/classes/resolver/command/console/class_TestsConsoleCommandResolver.php @@ -69,6 +69,7 @@ class TestsConsoleCommandResolver extends BaseCommandResolver implements Command // Set the application instance $resolverInstance->setApplicationInstance($applicationInstance); + $resolverInstance->setNamespace('CoreFramework\Tests\Command'); // Return the prepared instance return $resolverInstance; diff --git a/application/tests/config.php b/application/tests/config.php index 066a2a21..a4e6d863 100644 --- a/application/tests/config.php +++ b/application/tests/config.php @@ -44,3 +44,6 @@ $cfg->setConfigEntry('news_download_filter', 'CoreFramework\Filter\News\NewsDown // CFG: NEWS-PROCESS-FILTER $cfg->setConfigEntry('news_process_filter', 'CoreFramework\Filter\News\NewsProcessFilter'); + +// CFG: NEWS-READER-MAIN-CLASS +$cfg->setConfigEntry('news_reader_main_class', 'CoreFramework\Reader\News\Console\ConsoleNewsReader'); diff --git a/inc/main/classes/factories/cache/class_CacheFactory.php b/inc/main/classes/factories/cache/class_CacheFactory.php index 73a63d97..bc7d5a5d 100644 --- a/inc/main/classes/factories/cache/class_CacheFactory.php +++ b/inc/main/classes/factories/cache/class_CacheFactory.php @@ -3,6 +3,7 @@ namespace CoreFramework\Factory\Cache; // Import framework stuff +use CoreFramework\Factory\BaseFactory; use CoreFramework\Factory\ObjectFactory; /** diff --git a/inc/main/classes/factories/html/class_HtmlNewsFactory.php b/inc/main/classes/factories/html/class_HtmlNewsFactory.php index ce86ac75..f98fe98d 100644 --- a/inc/main/classes/factories/html/class_HtmlNewsFactory.php +++ b/inc/main/classes/factories/html/class_HtmlNewsFactory.php @@ -3,6 +3,7 @@ namespace CoreFramework\Factory\News; // Import framework stuff +use CoreFramework\Factory\BaseFactory; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Request\Requestable; diff --git a/inc/main/classes/factories/logger/class_LoggerFactory.php b/inc/main/classes/factories/logger/class_LoggerFactory.php index 6528ed54..38036608 100644 --- a/inc/main/classes/factories/logger/class_LoggerFactory.php +++ b/inc/main/classes/factories/logger/class_LoggerFactory.php @@ -3,6 +3,7 @@ namespace CoreFramework\Logging; // Import framework stuff +use CoreFramework\Factory\BaseFactory; use CoreFramework\Generic\FrameworkInterface; /** diff --git a/inc/main/classes/filter/news/class_NewsDownloadFilter.php b/inc/main/classes/filter/news/class_NewsDownloadFilter.php index 80cbd9b2..e336c507 100644 --- a/inc/main/classes/filter/news/class_NewsDownloadFilter.php +++ b/inc/main/classes/filter/news/class_NewsDownloadFilter.php @@ -3,6 +3,7 @@ namespace CoreFramework\Filter\News; // Import framework stuff +use CoreFramework\Factory\News\HtmlNewsFactory; use CoreFramework\Filter\BaseFilter; use CoreFramework\Filter\Filterable; use CoreFramework\Registry\Registry; diff --git a/inc/main/classes/reader/class_ConsoleNewsReader.php b/inc/main/classes/reader/class_ConsoleNewsReader.php index cac28360..b00c5d62 100644 --- a/inc/main/classes/reader/class_ConsoleNewsReader.php +++ b/inc/main/classes/reader/class_ConsoleNewsReader.php @@ -1,10 +1,11 @@ isCommandValid($commandName) === FALSE) { + if ($this->isCommandValid($this->getNamespace(), $commandName) === FALSE) { // This command is invalid! throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); } // END - if