]> git.mxchange.org Git - core.git/commitdiff
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 4bb2c255c04509a48c252fa6726a15ca02c19a38..c12ab629cf7477e2071a1c2d0da78b6fb9091b4a 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 22f4f5e7b57711356f2310f7b5531ea14f985857..d36f486ab0c65ec5d4db0c62a7c6fc9ecf3c407f 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 a58f33e330b1de5a454c141aa0b3ee7a38ef5318..01cee1902c40f8bacfab6242c1586f5c4b98a017 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 b03c2df923743fe21d9b0f372e91c60a8107de7b..f1c193044d31762a039150632961d58983f6ebdc 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 f8bc1c5ac192fe93f69d80920844aa00a416874a..50350bb3daeb18e7c3e976d1e956697d6e5d23f7 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 6db2c2cef9fc5f6bb1da027c019aa567052584bd..909cb92f4cadcaf51f56f684c5133e0708083d77 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 5238d4de0d82afd3f686f45f0f401c735146f617..fefa24ae8e8a76c8ff09094979930ce340b17c73 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 62f3149fc91a9ffda06491d2063a6e4e4d1cac10..7188904ce840607d75e82890c0e9b87511c7632a 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 c27e373ad59c2fc5fe38f76ea2432328ffd958b7..20111df2a92cec3565f817f3fb67da6ca91cdf6c 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 ded4010456967f3483007ee9f505ef8005794386..fa669104c10046e0a20e4e761076b2620cf2233d 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 b90ca40480ff0badbf1bdd2a87433115970f75b9..a796c01769d3bfebf925323d652b769ced62a35f 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 e8867d447a45a85bcbb150828a233fa11cb18d4d..388cf4ca17ed2d1961bd14ad00403bb3694673cb 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 cd6579675b2f6277578b8e820e69ce0e2429c6e5..57e8f64a4646e8861d5206eebf2d7da954f7c432 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 4532722f1936eabfff225065c057f5cff86f75b3..938e3cc9c235135770dcfbcb0082f14bc665ec99 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 958764245fcc751144224c24c71147b7bad98bb1..14345a554f459004eabb6f40d3a7f0d7c30efd81 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 e8729947379909379d344651dafe5030bdff4563..426976bca63915a177e318ff6dc03299ea2a7a78 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 7a06feb85fb4e80031866d0e1f10934763e9a656..d8761931cef5d7286d70ea676646070c9b291e2f 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 2b62566d7fee796fda0e13d209382884f778f69e..528e55f55deb1a15dd0cad24779fc680761bde77 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Command;
 
 // Import framework stuff
+use CoreFramework\Action\PerformableAction;
 use CoreFramework\Request\Requestable;
 
 /**