]> git.mxchange.org Git - hub.git/blobdiff - application/hub/class_ApplicationHelper.php
First initial import for a web interface, this will later allow to browse and
[hub.git] / application / hub / class_ApplicationHelper.php
index a44051c982105d1c5bd0491a77dc1317da22e9a5..ad4d8626ac19d789728f78132992f6e6ab685ba6 100644 (file)
@@ -194,6 +194,15 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                        $requestInstance->setRequestElement('command', $commandName);
                } // END - if
 
+               // Is the responseType 'html' ?
+               if ($responseType == 'html') {
+                       // The language system is needed for this
+                       $languageInstance = ObjectFactory::createObjectByConfiguredName('language_system_class');
+
+                       // And set it here
+                       $this->setLanguageInstance($languageInstance);
+               } // END - if
+
                // Get a controller resolver
                $resolverClass = self::convertToClassName($this->getAppShortName() . '_' . $responseType . '_controller_resolver');
                $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this));
@@ -204,12 +213,15 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                // Launch the hub main routine here
                $this->getControllerInstance()->handleRequest($requestInstance, $responseInstance);
 
-               // -------------------------- Shutdown phase --------------------------
-               // Shutting down the hub by saying "good bye" to all connected peers
-               // and other hubs, flushing all queues and caches.
-               self::createDebugInstance(__CLASS__)->debugOutput('MAIN: Shutdown in progress, main loop exited.');
-               $this->getControllerInstance()->executeShutdownFilters($requestInstance, $responseInstance);
-               self::createDebugInstance(__CLASS__)->debugOutput('MAIN: Shutdown completed. (This is the last line.)');
+               // Only for console requests as this is the actual daemon
+               if ($responseType == 'console') {
+                       // -------------------------- Shutdown phase --------------------------
+                       // Shutting down the hub by saying "good bye" to all connected peers
+                       // and other hubs, flushing all queues and caches.
+                       self::createDebugInstance(__CLASS__)->debugOutput('MAIN: Shutdown in progress, main loop exited.');
+                       $this->getControllerInstance()->executeShutdownFilters($requestInstance, $responseInstance);
+                       self::createDebugInstance(__CLASS__)->debugOutput('MAIN: Shutdown completed. (This is the last line.)');
+               } // END - if
        }
 
        /**