From 92b0065f15f8e2618a6a951302cba21b55ef6ad7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 21 Nov 2009 19:45:13 +0000 Subject: [PATCH] Added a filter for checking if all requirements in PHP did meet --- .gitattributes | 1 + application/hub/config.php | 3 + .../console/class_HubConsoleMainCommand.php | 1 + application/hub/main/filter/node/class_Node | 2 +- .../node/class_NodePhpRequirementsFilter.php | 63 +++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 application/hub/main/filter/node/class_NodePhpRequirementsFilter.php diff --git a/.gitattributes b/.gitattributes index 6657d302b..9f2020012 100644 --- a/.gitattributes +++ b/.gitattributes @@ -118,6 +118,7 @@ application/hub/main/filter/console/class_ConsoleWelcomeTeaserFilter.php -text application/hub/main/filter/node/.htaccess -text application/hub/main/filter/node/class_Node -text application/hub/main/filter/node/class_NodeInitializationFilter.php -text +application/hub/main/filter/node/class_NodePhpRequirementsFilter.php -text application/hub/main/filter/shutdown/.htaccess -text application/hub/main/filter/shutdown/class_HubShutdown -text application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php -text diff --git a/application/hub/config.php b/application/hub/config.php index 95eceb9cf..00fe3d013 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -129,6 +129,9 @@ $cfg->setConfigEntry('news_download_filter', 'NewsDownloadFilter'); // CFG: NEWS-PROCESS-FILTER $cfg->setConfigEntry('news_process_filter', 'NewsProcessFilter'); +// CFG: NODE-PHP-REQUIREMENTS-FILTER +$cfg->setConfigEntry('node_php_requirements_filter', 'NodePhpRequirementsFilter'); + // CFG: NODE-INITIALIZER-FILTER $cfg->setConfigEntry('node_initializer_filter', 'NodeInitializationFilter'); diff --git a/application/hub/main/commands/console/class_HubConsoleMainCommand.php b/application/hub/main/commands/console/class_HubConsoleMainCommand.php index 4f087269f..424717577 100644 --- a/application/hub/main/commands/console/class_HubConsoleMainCommand.php +++ b/application/hub/main/commands/console/class_HubConsoleMainCommand.php @@ -108,6 +108,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add pre filters + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_php_requirements_filter')); $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_initializer_filter')); $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('console_welcome_teaser_filter')); diff --git a/application/hub/main/filter/node/class_Node b/application/hub/main/filter/node/class_Node index 9495b56af..969e7cad9 100644 --- a/application/hub/main/filter/node/class_Node +++ b/application/hub/main/filter/node/class_Node @@ -55,7 +55,7 @@ class Node???Filter extends BaseFilter implements Filterable { */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Implement this! - $this->partialStub("Please implement this method."); + $this->partialStub('Please implement this method.'); } } diff --git a/application/hub/main/filter/node/class_NodePhpRequirementsFilter.php b/application/hub/main/filter/node/class_NodePhpRequirementsFilter.php new file mode 100644 index 000000000..2012ca5d4 --- /dev/null +++ b/application/hub/main/filter/node/class_NodePhpRequirementsFilter.php @@ -0,0 +1,63 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class NodePhpRequirementsFilter extends BaseFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createNodePhpRequirementsFilter () { + // Get a new instance + $filterInstance = new NodePhpRequirementsFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Implement this! + $this->partialStub('Please implement this method.'); + } +} + +// [EOF] +?> -- 2.39.5