]> git.mxchange.org Git - city.git/commitdiff
More fixes for HTML and console (daemon) + updated 'core'.
authorRoland Haeder <roland@mxchange.org>
Mon, 6 Apr 2015 00:08:38 +0000 (02:08 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 6 Apr 2015 00:08:38 +0000 (02:08 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
application/city/class_ApplicationHelper.php
application/city/config.php
application/city/main/controller/html/class_CityHtmlDefaultNewsController.php
application/city/main/resolver/controller/html/class_CityHtmlControllerResolver.php
core

index 943b3d8c0a1fbd569701df3cb91676a4142899e4..fc1a3c9242fd64ab8ab08bca08264820312800c1 100644 (file)
@@ -184,8 +184,17 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                        // Get default command
                        $commandName = $responseInstance->getDefaultCommand();
 
+                       // Default is 'page'
+                       $element = 'page';
+
+                       // Is the request type console?
+                       if ($responseType === 'console') {
+                               // Console applications have only commands
+                               $element = 'command';
+                       } // END - if
+
                        // Set it in request
-                       $requestInstance->setRequestElement('command', $commandName);
+                       $requestInstance->setRequestElement($element, $commandName);
                } // END - if
 
                // Get a controller resolver
index 4c1275ba66025837f160ef0cc4a446aa77795ca2..779e6fb9dc2a1f2dd2647c1a7f12067fa9302105 100644 (file)
@@ -56,11 +56,11 @@ $cfg->setConfigEntry('default_html_command', 'home');
 // CFG: DEFAULT-CITY-HTML-COMMAND
 $cfg->setConfigEntry('default_city_html_command', 'home');
 
-// CFG: HTML-CMD-HOME-RESOLVER-CLASS
-$cfg->setConfigEntry('html_cmd_home_resolver_class', 'CityHtmlCommandResolver');
+// CFG: CITY-HTML-CMD-HOME-RESOLVER-CLASS
+$cfg->setConfigEntry('city_html_cmd_home_resolver_class', 'CityHtmlCommandResolver');
 
-// CFG: HTML-CMD-REGISTER-RESOLVER-CLASS
-$cfg->setConfigEntry('html_cmd_register_resolver_class', 'CityHtmlCommandResolver');
+// CFG: CITY-HTML-CMD-REGISTER-RESOLVER-CLASS
+$cfg->setConfigEntry('city_html_cmd_register_resolver_class', 'CityHtmlCommandResolver');
 
 // CFG: NEWS-READER-REGISTER-CLASS
 $cfg->setConfigEntry('news_reader_register_class', 'DefaultNewsReader');
@@ -84,6 +84,9 @@ $cfg->setConfigEntry('menu_template_extension', '.xml');
  *                              Console client                                *
  ******************************************************************************/
 
+// CFG: DEFAULT-CONSOLE-COMMAND
+$cfg->setConfigEntry('default_console_command', 'daemon');
+
 // CFG: DEFAULT-CITY-CONSOLE-COMMAND
 $cfg->setConfigEntry('default_city_console_command', 'daemon');
 
@@ -108,6 +111,9 @@ $cfg->setConfigEntry('city_shutdown_task_handler_filter', 'CityShutdownTaskHandl
 // CFG: CITY-SHUTDOWN-CITY-FILTER
 $cfg->setConfigEntry('city_shutdown_city_filter', 'CityShutdownCityFilter');
 
+// CFG: NEWS-READER-DAEMON-CLASS
+$cfg->setConfigEntry('news_reader_daemon_class', 'ConsoleNewsReader');
+
 // CFG: NEWS-DAEMON-LIMIT
 $cfg->setConfigEntry('news_daemon_limit', 5);
 
index 63071a9ae24077abb0c198ac4c4584e2b72a0d74..9ec49146df7fd15b5331bbf6b76092c72c0f9596 100644 (file)
@@ -66,47 +66,8 @@ class CityHtmlDefaultNewsController extends BaseController implements Controller
         * @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 shutdown filter
-        *
-        * @param       $filterInstance         A Filterable class
-        * @return      void
-        */
-       public function addShutdownFilter (Filterable $filterInstance) {
-               $this->addFilter('shutdown', $filterInstance);
-       }
-
-       /**
-        * Executes all shutdown filters
-        *
-        * @param       $requestInstance        A Requestable class
-        * @param       $responseInstance       A Responseable class
-        * @return      void
-        */
-       public function executeShutdownFilters (Requestable $requestInstance, Responseable $responseInstance) {
-               $this->executeFilters('shutdown', $requestInstance, $responseInstance);
+               // Generic pre-post command execution
+               $this->executeGenericPrePostCommand($requestInstance, $responseInstance);
        }
 }
 
index 8611b80a2413a89429f76b711c4af355f5a946f4..4164595b260f05756d013d9141ba73a742ac480c 100644 (file)
@@ -31,8 +31,8 @@ class CityHtmlControllerResolver extends BaseControllerResolver implements Contr
                // Call parent constructor
                parent::__construct(__CLASS__);
 
-               // Set prefix to 'Html'
-               $this->setClassPrefix('html');
+               // Set prefix to 'city_html'
+               $this->setClassPrefix('city_html');
        }
 
        /**
diff --git a/core b/core
index 64d9752d26925eb4389f478362e84e77dee6057a..b06a10407c5515a96a2905f4cfffa5894d2862dc 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 64d9752d26925eb4389f478362e84e77dee6057a
+Subproject commit b06a10407c5515a96a2905f4cfffa5894d2862dc