Continued:
authorRoland Haeder <roland@mxchange.org>
Sat, 25 Feb 2017 14:02:51 +0000 (15:02 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Feb 2017 21:10:04 +0000 (22:10 +0100)
- added main command for "tests"
- added "import" for BaseCommand
- added "import" for PerformableAction

Signed-off-by: Roland H├Ąder <roland@mxchange.org>
21 files changed:
application/tests/classes/commands/.htaccess [new file with mode: 0644]
application/tests/classes/commands/console/.htaccess [new file with mode: 0644]
application/tests/classes/commands/console/class_TestsConsoleMainCommand.php [new file with mode: 0644]
inc/main/classes/actions/post_registration/class_LoginAfterRegistrationAction.php
inc/main/classes/commands/console/class_ConsoleFuseCommand.php
inc/main/classes/commands/html/class_HtmlConfirmCommand.php
inc/main/classes/commands/html/class_HtmlDoFormCommand.php
inc/main/classes/commands/html/class_HtmlHomeCommand.php
inc/main/classes/commands/html/class_HtmlLoginAreaCommand.php
inc/main/classes/commands/html/class_HtmlLoginCommand.php
inc/main/classes/commands/html/class_HtmlLoginFailedCommand.php
inc/main/classes/commands/html/class_HtmlLogoutCommand.php
inc/main/classes/commands/html/class_HtmlLogoutDoneCommand.php
inc/main/classes/commands/html/class_HtmlProblemCommand.php
inc/main/classes/commands/html/class_HtmlRegisterCommand.php
inc/main/classes/commands/html/class_HtmlResendLinkCommand.php
inc/main/classes/commands/html/class_HtmlStatusCommand.php
inc/main/classes/commands/image/class_ImageCodeCaptchaCommand.php
inc/main/classes/filter/payment/class_PaymentDiscoveryFilter.php
inc/main/classes/resolver/command/console/class_ConsoleCommandResolver.php
inc/main/interfaces/actions/commands/class_Commandable.php

diff --git a/application/tests/classes/commands/.htaccess b/application/tests/classes/commands/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/tests/classes/commands/console/.htaccess b/application/tests/classes/commands/console/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/tests/classes/commands/console/class_TestsConsoleMainCommand.php b/application/tests/classes/commands/console/class_TestsConsoleMainCommand.php
new file mode 100644 (file)
index 0000000..81a2a47
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+// Own namespace
+namespace CoreFramework\Tests\Command;
+
+// Import framework stuff
+use CoreFramework\Command\BaseCommand;
+
+/**
+ * A command for the 'main' routine
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.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 <http://www.gnu.org/licenses/>.
+ */
+class TestsConsoleMainCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance       An instance of a command resolver class
+        * @return      $commandInstance        An instance a prepared command class
+        */
+       public static final function createTestsConsoleMainCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new TestsConsoleMainCommand();
+
+               // Set the application instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the given command 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        Try to create a TestsActivationTask or so
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get a registry and the application instance from it
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
+               // Debug message
+               self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main ... ---');
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @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) {
+               // 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'));
+       }
+
+}
index 4bb2c25..c12ab62 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Action\PostRegistration\Login;
 
 // Import framework stuff
+use CoreFramework\Action\PerformableAction;
 use CoreFramework\Generic\FrameworkException;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index 22f4f5e..d36f486 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Fuse;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index a58f33e..01cee19 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Guest;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Registry\Generic\Registry;
index b03c2df..f1c1930 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Form;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index f8bc1c5..50350bb 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Guest;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index 6db2c2c..909cb92 100644 (file)
@@ -3,6 +3,8 @@
 namespace CoreFramework\Command\Login;
 
 // Import framework stuff
+use CoreFramework\Action\PerformableAction;
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Generic\Registry;
 use CoreFramework\Request\Requestable;
index 5238d4d..fefa24a 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Login;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Registerable;
 use CoreFramework\Registry\Generic\Registry;
index 62f3149..7188904 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Failed;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index c27e373..20111df 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Login;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index ded4010..fa66910 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Logout;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index b90ca40..a796c01 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Failed;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index e8867d4..388cf4c 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Register;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Registerable;
 use CoreFramework\Registry\Generic\Registry;
index cd65796..57e8f64 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Guest;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Generic\Registry;
 use CoreFramework\Request\Requestable;
index 4532722..938e3cc 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Status;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index 9587642..14345a5 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command\Captcha;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index e872994..426976b 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Filter\Discovery\Payment;
 
 // Import framework stuff
+use CoreFramework\Action\PerformableAction;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Loader\NoClassException;
index 7a06feb..d876193 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Resolver\Command;
 
 // Import framework stuff
+use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\InvalidCommandException;
 use CoreFramework\Manager\ManageableApplication;
 
index 2b62566..528e55f 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command;
 
 // Import framework stuff
+use CoreFramework\Action\PerformableAction;
 use CoreFramework\Request\Requestable;
 
 /**