X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Fclass_ApplicationHelper.php;h=87a4e309fdbce3cc20ff6dd55d45818c01ba9cc2;hb=b44e5e7347f9a1dbd49b5b47d506a4f6526caf2f;hp=0e263851817a3483f2dba932a10385bab033a000;hpb=b226bbefe6bc09bcd75432c3c3ba32bf7da45b71;p=shipsimu.git diff --git a/application/ship-simu/class_ApplicationHelper.php b/application/ship-simu/class_ApplicationHelper.php index 0e26385..87a4e30 100644 --- a/application/ship-simu/class_ApplicationHelper.php +++ b/application/ship-simu/class_ApplicationHelper.php @@ -60,11 +60,15 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica */ private $masterTemplate = "shipsimu_main"; + /** + * An instance of a controller + */ + private $controllerInstance = null; + /** * An instance of this class */ private static $thisInstance = null; - /** * Protected constructor * @@ -78,7 +82,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $this->setObjectDescription("Application-Helper"); // Create an unique ID - $this->createUniqueID(); + $this->generateUniqueId(); // Tidy up a little $this->removeSystemArray(); @@ -178,30 +182,44 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica */ public final function entryPoint () { // Create a new request object - $requestInstance = HttpRequest::createHttpRequest(); + $requestInstance = ObjectFactory::createObjectByName('HttpRequest'); // ... and a new response object $responseInstance = HttpResponse::createHttpResponse($this); // Get command parameter - $commandPara = $this->getConfigInstance()->readConfig("command_parameter"); + $commandPara = $this->getConfigInstance()->readConfig('command_parameter'); // Get the parameter from the request $commandName = $requestInstance->getRequestElement($commandPara); // If it is null then get default command if (is_null($commandName)) { - $commandName = $this->getConfigInstance()->readConfig("default_command"); + $commandName = $this->getConfigInstance()->readConfig('default_command'); } // Get a resolver $resolverInstance = WebControllerResolver::createWebControllerResolver($commandName, $this); - // Get a new controller instance as well - $controllerInstance = $resolverInstance->resolveCommandController(); + // Get a controller instance as well + $this->controllerInstance = $resolverInstance->resolveCommandController(); // Handle the request - $controllerInstance->handleRequest($requestInstance, $responseInstance); + $this->controllerInstance->handleRequest($requestInstance, $responseInstance); + } + + /** + * Handle the indexed array of fatal messages and puts them out in an + * acceptable fasion + * + * @param $messageList An array of fatal messages + * @return void + */ + public function handleFatalMessages (array $messageList) { + // Walk through all messages + foreach ($messageList as $message) { + print("MSG:".$message."
\n"); + } } }