X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fresolver%2Fcontroller%2Fclass_BaseControllerResolver.php;h=3b2e44333d9510512b478ace488b12328441ca03;hb=d26e71af1e28dc1429823bdec244df6303f9b2fb;hp=3cef50bbeed71227f77a027e8a8740c6c41d83e0;hpb=c6d8f7eb4020504335a62e07a8ead8d40868cde7;p=core.git diff --git a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php index 3cef50bb..3b2e4433 100644 --- a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php +++ b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php @@ -2,11 +2,11 @@ /** * A generic controller resolver class * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @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 @@ -60,7 +60,7 @@ class BaseControllerResolver extends BaseResolver { /** * "Loads" a given controller and instances it if not yet cached. If the * controller was not found one of the default controllers will be used - * depending on wether news shall be displayed. + * depending on whether news shall be displayed. * * @param $controllerName A controller name we shall look for * @return $controllerInstance A loaded controller instance @@ -72,13 +72,13 @@ class BaseControllerResolver extends BaseResolver { $defaultController = $this->getConfigInstance()->getConfigEntry('default_' . strtolower($this->getClassPrefix()) . '_command'); // Init controller instance - $controllerInstance = null; + $controllerInstance = NULL; // Default controller $this->setClassName($this->getClassPrefix() . 'DefaultNewsController'); // Generate the class name - //* DEBUG: */ echo __METHOD__.": Controller=".$controllerName; + //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BEFORE: controller=' . $controllerName); if ($controllerName != $defaultController) { // Create controller class name $className = $this->getClassPrefix() . $this->convertToClassName($controllerName) . 'Controller'; @@ -89,7 +89,7 @@ class BaseControllerResolver extends BaseResolver { // No news at main command or non-news command $this->setClassName($this->getClassPrefix() . 'DefaultNewsController'); } - //* DEBUG: */ echo ", controller=".$this->getClassName()."
\n"; + //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('AFTER: controller=' . $this->getClassName()); // Is this class loaded? if (!class_exists($this->getClassName())) { @@ -101,7 +101,7 @@ class BaseControllerResolver extends BaseResolver { $resolverConfigEntry = ''; // Try to read a config entry for our resolver including controller name... ;-) - $resolverConfigEntry = sprintf("%s_cmd_%s_resolver_class", strtolower($this->getClassPrefix()), strtolower($controllerName)); + $resolverConfigEntry = sprintf('%s_cmd_%s_resolver_class', strtolower($this->getClassPrefix()), strtolower($controllerName)); // Get the config, this will throw an exception if there is no special command resolver $resolverClass = $this->getConfigInstance()->getConfigEntry($resolverConfigEntry); @@ -124,16 +124,16 @@ class BaseControllerResolver extends BaseResolver { } /** - * Checks wether the given controller is valid + * Checks whether the given controller is valid * * @param $controllerName The default controller we shall execute - * @return $isValid Wether the given controller is valid + * @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) { // By default nothing shall be valid - $isValid = false; + $isValid = FALSE; // Is a controller set? if (empty($controllerName)) { @@ -148,11 +148,11 @@ class BaseControllerResolver extends BaseResolver { $this->setClassName($className); // Try it hard to get an controller - while ($isValid === false) { + while ($isValid === FALSE) { // Is this class already loaded? if (class_exists($this->getClassName())) { // This class does exist. :-) - $isValid = true; + $isValid = TRUE; } elseif ($this->getClassName() != $this->getClassPrefix() . 'DefaultNewsController') { // Set default controller $this->setClassName($this->getClassPrefix() . 'DefaultNewsController');