]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/resolver/controller/class_BaseControllerResolver.php
A lot rewrites and fixes for weak redirect methods
[shipsimu.git] / inc / classes / main / resolver / controller / class_BaseControllerResolver.php
index 75a1b8ebe8d815c20ac556bbd00324d25bb2292a..a667fe6cf2724fb5d52a5a2fbda87db5b8f2e3e9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -77,8 +77,8 @@ class BaseControllerResolver extends BaseResolver {
         *
         * @param       $controllerName         The default controller we shall execute
         * @return      $isValid                        Wether the given controller is valid
-        * @throws      EmptyVariableException  Thrown if the given controller is not set
-        * @throws      DefaultControllerException      If the default controller was not found
+        * @throws      EmptyVariableException          Thrown if given controller is not set
+        * @throws      DefaultControllerException      Thrown if default controller was not found
         */
        public function isControllerValid ($controllerName) {
                // By default nothing shall be valid
@@ -97,19 +97,19 @@ class BaseControllerResolver extends BaseResolver {
                ));
 
                // Try it hard to get an controller
-               while (!$isValid) {
+               while ($isValid === false) {
                        // Is this class already loaded?
                        if (class_exists($this->getClassName())) {
                                // This class does exist. :-)
                                $isValid = true;
-                       } elseif (($this->getClassName() != $this->controllerPrefix."DefaultController") && ($this->getClassName() != $this->controllerPrefix."DefaultNewsController")) {
+                       } elseif (($this->getClassName() != $this->controllerPrefix.'DefaultController') && ($this->getClassName() != $this->controllerPrefix.'DefaultNewsController')) {
                                // Do we have news?
                                if ($this->getConfigInstance()->readConfig('page_with_news') == $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page')) {
                                        // Yes, display news in home then set default controller with news
-                                       $this->setClassName($this->controllerPrefix."DefaultNewsController");
+                                       $this->setClassName($this->controllerPrefix . 'DefaultNewsController');
                                } else {
-                                       // No news at "home" page or non-news page
-                                       $this->setClassName($this->controllerPrefix."DefaultController");
+                                       // No news at home page or non-news page
+                                       $this->setClassName($this->controllerPrefix . 'DefaultController');
                                }
                        } else {
                                // All is tried, give it up here
@@ -117,9 +117,6 @@ class BaseControllerResolver extends BaseResolver {
                        }
                } // END - while
 
-               // Debug output
-               //* DEBUG: */ $this->debugBackTrace();
-
                // Return the result
                return $isValid;
        }