* @return void
*/
public final function entryPoint () {
+ // Create a new request object
+ $requestInstance = ObjectFactory::createObjectByName('ConsoleRequest');
+
+ // Remember request instance here
+ $this->setRequestInstance($requestInstance);
+
+ // Default response is console
+ $response = 'console';
+ $responseType = 'console';
+
+ // Do we have another response?
+ if ($requestInstance->isRequestElementSet('request')) {
+ // Then use it
+ $response = strtolower($requestInstance->getRequestElement('request'));
+ $responseType = $response;
+ } // END - if
+
+ // ... and a new response object
+ $responseClass = sprintf("%sResponse", $this->convertToClassName($response));
+ $responseInstance = ObjectFactory::createObjectByName($responseClass, array($this));
+
+ // Remember response instance here
+ $this->setResponseInstance($responseInstance);
+
+ // Get the parameter from the request
+ $commandName = $requestInstance->getRequestElement('page');
+
+ // If it is null then get default command
+ if (is_null($commandName)) {
+ $commandName = $responseInstance->getDefaultCommand();
+ } // END - if
+
+ // Get a resolver
+ $resolverClass = sprintf("%sControllerResolver", $this->convertToClassName($responseType));
+ $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this));
+
+ // Get a controller instance as well
+ $this->controllerInstance = $resolverInstance->resolveController();
+
+ // Handle the request
+ $this->controllerInstance->handleRequest($requestInstance, $responseInstance);
// ----------------------------- Init phase ---------------------------
+
// The default node-mode is from our configuration
$nodeMode = $this->getConfigInstance()->readConfig('node_mode');
+ die("Until here!\n");
// Prepare a ConsoleRequest class to catch all parameters
$requestInstance = ObjectFactory::createObjectByName('ConsoleRequest');
// Set the app instance
$nodeInstance->setApplicationInstance($this);
+
+ // Initialize all filters
+ $nodeInstance->initializeFilters();
} catch (ClassNotFoundException $e) {
// This exception means, the node mode is invalid.
// @TODO Can we rewrite this to app_die() ?
* @return $masterTemplateName Name of the master template
*/
public function buildMasterTemplateName () {
- return "node_main";
+ return 'node_main';
}
}