]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Fri, 24 Feb 2017 20:48:55 +0000 (21:48 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Feb 2017 21:10:04 +0000 (22:10 +0100)
- added missing controller for "tests" application (with own namespace)
- added "import" for BaseController

Signed-off-by: Roland Häder <roland@mxchange.org>
25 files changed:
application/tests/classes/controller/.htaccess [new file with mode: 0644]
application/tests/classes/controller/console/.htaccess [new file with mode: 0644]
application/tests/classes/controller/console/class_TestsConsoleDefaultNewsController.php [new file with mode: 0644]
application/tests/classes/resolver/controller/class_TestsConsoleControllerResolver.php
inc/main/classes/controller/console/class_ConsoleDefaultController.php
inc/main/classes/controller/console/class_ConsoleDefaultNewsController.php
inc/main/classes/controller/html/class_HtmlConfirmController.php
inc/main/classes/controller/html/class_HtmlDefaultController.php
inc/main/classes/controller/html/class_HtmlDefaultNewsController.php
inc/main/classes/controller/html/class_HtmlLoginController.php
inc/main/classes/controller/html/class_HtmlLoginFailedController.php
inc/main/classes/controller/html/class_HtmlLogoutController.php
inc/main/classes/controller/html/class_HtmlLogoutDoneController.php
inc/main/classes/controller/html/class_HtmlProblemController.php
inc/main/classes/controller/html/class_HtmlRegisterController.php
inc/main/classes/controller/html/class_HtmlStatusController.php
inc/main/classes/controller/html/form/class_HtmlDoFormController.php
inc/main/classes/controller/html/login/class_HtmlLoginAreaController.php
inc/main/classes/controller/image/captcha/class_ImageCodeCaptchaController.php
inc/main/classes/controller/image/class_ImageDefaultController.php
inc/main/classes/output/debug/console/class_DebugConsoleOutput.php
inc/main/classes/resolver/controller/class_BaseControllerResolver.php
inc/main/classes/resolver/controller/console/class_ConsoleControllerResolver.php
inc/main/classes/resolver/controller/html/class_HtmlControllerResolver.php
inc/main/classes/resolver/controller/image/class_ImageControllerResolver.php

diff --git a/application/tests/classes/controller/.htaccess b/application/tests/classes/controller/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/tests/classes/controller/console/.htaccess b/application/tests/classes/controller/console/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/tests/classes/controller/console/class_TestsConsoleDefaultNewsController.php b/application/tests/classes/controller/console/class_TestsConsoleDefaultNewsController.php
new file mode 100644 (file)
index 0000000..2f6e415
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+// Own namespace
+namespace CoreFramework\Tests\Controller;
+
+// Import framework stuff
+use CoreFramework\Controller\BaseController;
+
+/**
+ * The default controller with news for e.g. home or news page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub 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 TestsConsoleDefaultNewsController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Init additional filter chains
+               /*
+               foreach (array('bootstrap', 'activation','shutdown') as $filterChain) {
+                       $this->initFilterChain($filterChain);
+               } // END - foreach
+               */
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        */
+       public static final function createTestsConsoleDefaultNewsController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new TestsConsoleDefaultNewsController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Add news filters to this controller
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+
+               // Return the prepared instance
+               return $controllerInstance;
+       }
+
+       /**
+        * Handles the given request and response
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Run the pre filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+
+       /**
+        * Add a bootstrap filter
+        *
+        * @param       $filterInstance         A Filterable class
+        * @return      void
+        */
+       public function addBootstrapFilter (Filterable $filterInstance) {
+               $this->addFilter('bootstrap', $filterInstance);
+       }
+
+       /**
+        * Executes all bootstrap filters
+        *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
+        * @return      void
+        */
+       public function executeBootstrapFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->executeFilters('bootstrap', $requestInstance, $responseInstance);
+       }
+
+       /**
+        * Add a hub activation filter
+        *
+        * @param       $filterInstance         A Filterable class
+        * @return      void
+        */
+       public function addActivationFilter (Filterable $filterInstance) {
+               $this->addFilter('activation', $filterInstance);
+       }
+
+       /**
+        * Executes all hub activation filters
+        *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
+        * @return      void
+        */
+       public function executeActivationFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->executeFilters('activation', $requestInstance, $responseInstance);
+       }
+}
+
+// [EOF]
+?>
index 4a76f17b955b7c6e4355f3b4c43ecb62368e6939..f5ed6a9285eeae7959e2dc40530bdfccf960d951 100644 (file)
@@ -1,6 +1,10 @@
 <?php
 // Own namespace
-namespace CoreFramework\Resolver\Controller;
+namespace CoreFramework\Tests\Resolver\Controller;
+
+// Import framework stuff
+use CoreFramework\Controller\BaseController;
+use CoreFramework\Manager\ManageableApplication;
 
 /**
  * A resolver for resolving controllers locally
@@ -55,7 +59,7 @@ class TestsConsoleControllerResolver extends BaseControllerResolver implements C
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
+               } elseif ($resolverInstance->isControllerValid(__NAMESPACE__, $controllerName) === FALSE) {
                        // Invalid command found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
index 08f150580538414aca0785eeb324ba1749af8852..cd4afa3694d437d21ff31416ce484a5fb9b99e3e 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Default;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index a049d1b25282728e7e4e42ab688da96d9b5ddc00..2bcca95a7273d75fa7e2cc15c1059b44bc5222de 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Default;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index 4300853d293b2198d6f7362d858ac8b2223b7f43..dcdfa84048d510ba4c2bf2e3b3aa8e09d95e12a9 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Confirm;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Response\Responseable;
 
index fc958b88bdb4c8f9d69522e5cfbd547630b1bc6f..5fbf4e352cd0fd1152573a6947b7a63bedb6db30 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Default;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index 4f777407b65a90ed3ae3b50d4b4f1fe0ec951abc..8a793bb1c3cca9b782d8328fd9c917d51bb72fed 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\News;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Response\Responseable;
 
index 552c0b6b1879d284f6900db624907dd04f628d5a..ddcfb2e91311d130a9b2f10019ba1b4919e282f3 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Login;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index b1c1f7f36fe7e929d958c50d71376d3283408f0a..a32264a517b9a27bceaaddaf1231a9bb47fd9a5e 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Failed;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index 8cd75c352b45bd591d5a29d3140d46783f174620..8d96fb5d9416131634e10e24190bf2d0d655d5e6 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Logout;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index 93ea1371047878906000b9c5cca810e7098a3658..4a2fa09a5f762e20c9c3676512639294d176d3b3 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Logout;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 
 /**
index 89134f359b6df1341c95aed602a07f6cb1b83a63..de8bbf371f237e0bcd0d352729fa3c1862cf9d8d 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Problem;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index 194ead9ababeea2c784270f5f974acb455c53497..e6214f61d5bc41027b487ffd7538b3c2f78d64ef 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Register;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Response\Responseable;
 
 /**
index c5811bcf82b4d6463c96e17f72876199098d2fbe..59e13bd07d6effd853b4512361c5ab0c18ff6106 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Status;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index e667ec613d11506cde0f40ca6b7fe8bd6fe5ff18..d71343b5691195581de9a99be103be081f89a648 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Form;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index 7a03eb562eafd4bff3b51f791e714865413276a9..7b4c5d82264b71e69b630f672081eb9a5cd135d7 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Login;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index ddb0d44184a8325047e6eaa85b823dad2390dce5..a8144cee4f5458d1a87466df42933bca5a1c0b33 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Image\Captcha;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
index 882e480d9a8b15fc807c535cbd1cdde8906740b4..37424f9df3c126740ea7751b1a15f5d425238176 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Controller\Default;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
index 8c0a749ae3839c723f818a7311b419f6aa5781a3..3b6dff705046d6c41bc8a2c2a63ec418f9f9b6a8 100644 (file)
@@ -66,10 +66,7 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre
                if ($stripTags === TRUE) {
                        // Prepare the output without HTML tags
                        $output = trim(html_entity_decode(strip_tags(stripslashes($output))));
-               } else {
-                       // Prepare the output with HTML tags
-                       $output = trim(stripslashes($output));
-               }
+               } // END - if
 
                // Are debug times enabled?
                if ($this->getConfigInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_output_timings') == 'Y') {
index 13a086a8d9df44cb1fd44d4ecfd9809d256eb039..8f4f024825da0d0f06e20bb19824bf9f291c137c 100644 (file)
@@ -45,20 +45,28 @@ class BaseControllerResolver extends BaseResolver {
         * controller was not found one of the default controllers will be used
         * depending on whether news shall be displayed.
         *
+        * @param       $namespace                              Namespace to look in
         * @param       $controllerName                 A controller name we shall look for
         * @return      $controllerInstance             A loaded controller instance
         * @throws      InvalidControllerException      Thrown if even the requested
         *                                                                              controller class is missing (bad!)
         */
-       protected function loadController ($controllerName) {
+       protected function loadController ($namespace, $controllerName) {
                // Cache default controller
                $defaultController = $this->getConfigInstance()->getConfigEntry('default_' . strtolower($this->getClassPrefix()) . '_controller');
 
                // Init controller instance
                $controllerInstance = NULL;
 
+               // Create full class name
+               $className = sprintf(
+                       '%s\%sDefaultNewsController',
+                       $namespace,
+                       $this->getCapitalizedClassPrefix()
+               );
+
                // Default controller
-               $this->setClassName($this->getCapitalizedClassPrefix() . 'DefaultNewsController');
+               $this->setClassName($className);
 
                // Generate the class name
                //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BEFORE: controller=' . $controllerName);
@@ -70,7 +78,7 @@ class BaseControllerResolver extends BaseResolver {
                        $this->setClassName($className);
                } else {
                        // No news at main controller or non-news controller
-                       $this->setClassName($this->getCapitalizedClassPrefix() . 'DefaultNewsController');
+                       $this->setClassName($className);
                }
                //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('AFTER: controller=' . $this->getClassName());
 
@@ -109,23 +117,39 @@ class BaseControllerResolver extends BaseResolver {
        /**
         * Checks whether the given controller is valid
         *
+        * @param       $namespace                      Namespace to look in, no trailing backslash
         * @param       $controllerName         The default controller we shall execute
         * @return      $isValid                        Whether the given controller is valid
         * @throws      EmptyVariableException          Thrown if given controller is not set
         * @throws      DefaultControllerException      Thrown if default controller was not found
         */
-       public function isControllerValid ($controllerName) {
+       public function isControllerValid ($namespace, $controllerName) {
                // By default nothing shall be valid
                $isValid = FALSE;
 
-               // Is a controller set?
-               if (empty($controllerName)) {
+               // Is namespace and controller name set?
+               if (empty($namespace)) {
+                       // Then thrown an exception here
+                       throw new EmptyVariableException(array($this, 'namespace'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+               } elseif (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($this, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } // END - if
 
                // Create class name
-               $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($controllerName) . 'Controller';
+               $className = sprintf(
+                       '%s\%sController',
+                       $namespace,
+                       $this->getCapitalizedClassPrefix() . self::convertToClassName($controllerName)
+               );
+               $newsControllerName = sprintf(
+                       '%s\%sDefaultNewsController',
+                       $namespace,
+                       $this->getCapitalizedClassPrefix()
+               );
+
+               // Debug message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('className=%s', $className));
 
                // Now, let us create the full name of the controller class
                $this->setClassName($className);
@@ -136,9 +160,9 @@ class BaseControllerResolver extends BaseResolver {
                        if (class_exists($this->getClassName())) {
                                // This class does exist. :-)
                                $isValid = TRUE;
-                       } elseif ($this->getClassName() != $this->getCapitalizedClassPrefix() . 'DefaultNewsController') {
+                       } elseif ($this->getClassName() != $newsControllerName) {
                                // Set default controller
-                               $this->setClassName($this->getCapitalizedClassPrefix() . 'DefaultNewsController');
+                               $this->setClassName($newsControllerName);
                        } else {
                                // All is tried, give it up here
                                throw new DefaultControllerException($this, self::EXCEPTION_DEFAULT_CONTROLLER_GONE);
@@ -162,11 +186,12 @@ class BaseControllerResolver extends BaseResolver {
                $controllerName = '';
                $controllerInstance = NULL;
 
-               // Get the controller name 
+               // Get namespace and controller name
+               $namespace      = $this->getNamespace();
                $controllerName = $this->getControllerName();
 
                // Get the controller
-               $controllerInstance = $this->loadController($controllerName);
+               $controllerInstance = $this->loadController($namspace, $controllerName);
 
                // And validate it
                if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
index dd3554337a3fdc65148a2b0400d515f0e7993f2d..096a4b152b8c1dd29f79befa7186edc25b528970 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Resolver\Controller;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Manager\ManageableApplication;
 
 /**
@@ -44,13 +45,14 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro
        /**
         * Creates an instance of a resolver class with a given controller
         *
+        * @param       $namespace                                      Namespace to look in
         * @param       $controllerName                         The controller we shall resolve
         * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      EmptyVariableException          Thrown if default controller is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createConsoleControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+       public static final function createConsoleControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) {
                // Create the new instance
                $resolverInstance = new ConsoleControllerResolver();
 
@@ -58,7 +60,7 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
+               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === FALSE) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
index 8882dbdbb58187263dc242b97462d9aeff594d59..0890dff5da22dac72df8f598af0e305bcb71c9fb 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Resolver\Controller;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Manager\ManageableApplication;
 
 /**
@@ -44,13 +45,14 @@ class HtmlControllerResolver extends BaseControllerResolver implements Controlle
        /**
         * Creates an instance of a resolver class with a given controller
         *
+        * @param       $namespace                                      Namespace to look in
         * @param       $controllerName                         The controller we shall resolve
         * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      EmptyVariableException          Thrown if default controller is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createHtmlControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+       public static final function createHtmlControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) {
                // Create the new instance
                $resolverInstance = new HtmlControllerResolver();
 
@@ -58,7 +60,7 @@ class HtmlControllerResolver extends BaseControllerResolver implements Controlle
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
+               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === FALSE) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
index 7098713df858be5ad865a72316cf950f26ec0f40..3863c0e907c927ff6c746ea6d89689951f82527a 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Resolver\Controller;
 
 // Import framework stuff
+use CoreFramework\Controller\BaseController;
 use CoreFramework\Manager\ManageableApplication;
 
 /**
@@ -44,13 +45,14 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
        /**
         * Creates an instance of a resolver class with a given controller
         *
+        * @param       $namespace                                      Namespace to look in
         * @param       $controllerName                         The controller we shall resolve
         * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      EmptyVariableException          Thrown if default controller is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createImageControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+       public static final function createImageControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) {
                // Create the new instance
                $resolverInstance = new ImageControllerResolver();
 
@@ -58,7 +60,7 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
+               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === FALSE) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }