]> git.mxchange.org Git - hub.git/commitdiff
Extra bootstrapping steps added
authorRoland Häder <roland@mxchange.org>
Sat, 1 Aug 2009 21:34:57 +0000 (21:34 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 1 Aug 2009 21:34:57 +0000 (21:34 +0000)
.gitattributes
application/hub/config.php
application/hub/main/commands/console/class_HubConsoleMainCommand.php
application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php [new file with mode: 0644]

index 358421f21242e26ca36b7256fb300aba7b8fb0b2..5c741ad66fdd6348aca6bc6bc74762afc590c235 100644 (file)
@@ -61,6 +61,7 @@ application/hub/main/filter/.htaccess -text
 application/hub/main/filter/bootstrap/.htaccess -text
 application/hub/main/filter/bootstrap/class_ -text
 application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php -text
+application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php -text
 application/hub/main/filter/bootstrap/class_HubBootstrapGenSessionIdFilter.php -text
 application/hub/main/filter/bootstrap/class_HubBootstrapInitQueuesFilter.php -text
 application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php -text
index 46f2acf83fe13972bbbaac04692183785baeb052..db9722b8343e610de2121c6888e9ff3a6c57d524 100644 (file)
@@ -114,6 +114,9 @@ $cfg->setConfigEntry('hub_bootstrap_restore_nodelist_filter', 'HubBootstrapResto
 // CFG: HUB-BOOTSTRAP-INIT-QUEUES-FILTER
 $cfg->setConfigEntry('hub_bootstrap_init_queues_filter', 'HubBootstrapInitQueuesFilter');
 
+// CFG: HUB-BOOTSTRAP-EXTRA-BOOTSTRAP-FILTER
+$cfg->setConfigEntry('hub_bootstrap_extra_bootstrap_filter', 'HubBootstrapExtraBootstrappingFilter');
+
 // CFG: NEWS-READER-CLASS
 $cfg->setConfigEntry('news_reader_class', 'ConsoleNewsReader');
 
index cf8a9a78b938eabb8cc257fc1f09eaa5e539e93f..20b23e4c8185584d827d32764bdb235e97ce98e6 100644 (file)
@@ -119,6 +119,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable {
                $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_gen_sessionid_filter'));
                $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_restore_nodelist_filter'));
                $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_init_queues_filter'));
+               $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('hub_bootstrap_extra_bootstrap_filter'));
        }
 }
 
diff --git a/application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php b/application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php
new file mode 100644 (file)
index 0000000..9c77572
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * A ExtraBootstrapping filter for bootstrapping
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HubBootstrapExtraBootstrappingFilter extends BaseFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createHubBootstrapExtraBootstrappingFilter () {
+               // Get a new instance
+               $filterInstance = new HubBootstrapExtraBootstrappingFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get node instance
+               $nodeInstance = Registry::getRegistry()->getInstance('node');
+
+               // Sanity-check on it
+               if (is_null($nodeInstance)) {
+                       // Throws a FilterChainException to stop further processing
+                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
+               } // END - if
+
+               // Do some extra bootstrapping steps
+               $nodeInstance->doBootstrapping();
+       }
+}
+
+// [EOF]
+?>