From aababdab2089856dbc7da45f437aaf1811a10b28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 12 Mar 2011 00:24:29 +0000 Subject: [PATCH] A lot new methods/class added and many cleanups: - Double-quotes converted to single to speed-up things a little - Wrong BaseconnectionInstance fixed - New methods introduced to cruncher: + doFetchWorkUnits(): To fetch WUs or generate test units + enableIsActive/isActive(): To test/set if the cruncher is active + initBufferQueues(): To initialize in/out buffer queues - addExtraCruncherFilters() renamed to addExtraFilters() - This method has now project-wide a Controller instance as first argument - Dublicate method call to addExtraFilters() removed which happens in the rewriting process - $appInstance renamed to $applicationInstance to have a better naming convention - Some deprecated classes removed (they where named wrong) - BaseHubCruncher (a generic class) extended: + It does now check if the in-buffer queue is filled (depending on a configurable threshold) + It implements initBufferQueues() from CruncherHelper interface - Copyright fixed in HubMcryptCruncher - The idle-loop task is now "genericly" registered in the TaskHandler class: + This implies that all task-based application will always have at least one (but really generic) task. + The method hasTasksLeft() will return 'true' in all situations unless the idle-loop task "kills" itself - Generic cruncher-activation filter added - The mentioned buffer queues are now initialized by a newly added filter class and handled by an own task class - More minor code-cleanups - TODOs.txt updated --- .gitattributes | 8 +- application/hub/config.php | 42 +++++++- application/hub/data.php | 6 +- application/hub/init.php | 6 -- .../cruncher/class_CruncherHelper.php | 35 ++++++- .../package/fragmenter/class_Fragmentable.php | 2 +- .../class_HubConsoleCruncherCommand.php | 33 ++++--- .../console/class_HubConsoleMainCommand.php | 32 ++++--- .../main/cruncher/class_BaseHubCruncher.php | 64 +++++++++++++ .../mcrypt/class_HubMcryptCruncher.php | 34 +++++-- .../cruncher/test/class_HubMcryptCruncher.php | 3 - .../cruncher/test/class_HubTestCruncher.php | 3 - .../cruncher/class_CruncherBootstrap | 2 +- ...rBootstrapBufferQueueInitializerFilter.php | 66 +++++++++++++ ...ncherBootstrapExtraBootstrappingFilter.php | 2 +- ...uncherBootstrapGenericActivationFilter.php | 69 ++++++++++++++ .../class_CruncherInitializationFilter.php | 6 +- .../node/class_NodeInitializationFilter.php | 6 +- ...s_CruncherTaskHandlerInitializerFilter.php | 7 +- ...class_NodeTaskHandlerInitializerFilter.php | 6 -- .../main/handler/tasks/class_TaskHandler.php | 4 + .../class_HubDescriptorHelper.php | 4 +- .../connection/class_HubSelfConnectHelper.php | 4 +- .../fragmenter/class_PackageFragmenter.php | 2 +- .../class_HubConsoleCommandResolver.php | 6 +- .../class_HubConsoleControllerResolver.php | 6 +- .../main/tags/package/class_PackageTags.php | 4 +- application/hub/main/tasks/class_ | 13 +-- .../test => tasks/cruncher}/.htaccess | 0 application/hub/main/tasks/cruncher/class_ | 72 ++++++++++++++ .../class_CruncherWorkUnitFetcherTask.php | 80 ++++++++++++++++ .../class_AnnouncementTemplateEngine.php | 16 +--- .../class_SelfConnectTemplateEngine.php | 16 +--- .../class_ObjectRegistryTemplateEngine.php | 16 +--- docs/TODOs.txt | 95 +++++++++++-------- index.php | 6 +- 36 files changed, 608 insertions(+), 168 deletions(-) delete mode 100644 application/hub/main/cruncher/test/class_HubMcryptCruncher.php delete mode 100644 application/hub/main/cruncher/test/class_HubTestCruncher.php create mode 100644 application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapBufferQueueInitializerFilter.php create mode 100644 application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php rename application/hub/main/{cruncher/test => tasks/cruncher}/.htaccess (100%) create mode 100644 application/hub/main/tasks/cruncher/class_ create mode 100644 application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php diff --git a/.gitattributes b/.gitattributes index 5847ecfbb..a612fca3a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -140,9 +140,6 @@ application/hub/main/cruncher/class_ -text application/hub/main/cruncher/class_BaseHubCruncher.php svneol=native#text/plain application/hub/main/cruncher/mcrypt/.htaccess svneol=native#text/plain application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php svneol=native#text/plain -application/hub/main/cruncher/test/.htaccess svneol=native#text/plain -application/hub/main/cruncher/test/class_HubMcryptCruncher.php svneol=native#text/plain -application/hub/main/cruncher/test/class_HubTestCruncher.php svneol=native#text/plain application/hub/main/database/.htaccess -text svneol=unset#text/plain application/hub/main/database/wrapper/.htaccess -text svneol=unset#text/plain application/hub/main/database/wrapper/class_NodeInformationDatabaseWrapper.php -text svneol=unset#text/plain @@ -191,7 +188,9 @@ application/hub/main/filter/bootstrap/class_HubBootstrapListenerPoolFilter.php - application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php -text svneol=unset#text/plain application/hub/main/filter/bootstrap/cruncher/.htaccess svneol=native#text/plain application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap -text +application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapBufferQueueInitializerFilter.php svneol=native#text/plain application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php svneol=native#text/plain +application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php svneol=native#text/plain application/hub/main/filter/bootstrap/node/.htaccess svneol=native#text/plain application/hub/main/filter/bootstrap/node/class_NodeBootstrap -text application/hub/main/filter/bootstrap/node/class_NodeBootstrapExtraBootstrappingFilter.php svneol=native#text/plain @@ -398,6 +397,9 @@ application/hub/main/tags/package/class_PackageTags.php svneol=native#text/plain application/hub/main/tasks/.htaccess -text svneol=unset#text/plain application/hub/main/tasks/class_ -text svneol=unset#text/plain application/hub/main/tasks/class_BaseTask.php -text svneol=unset#text/plain +application/hub/main/tasks/cruncher/.htaccess svneol=native#text/plain +application/hub/main/tasks/cruncher/class_ -text +application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php svneol=native#text/plain application/hub/main/tasks/hub/.htaccess -text svneol=unset#text/plain application/hub/main/tasks/hub/announcement/.htaccess -text svneol=unset#text/plain application/hub/main/tasks/hub/announcement/class_HubSelfAnnouncementTask.php -text svneol=unset#text/plain diff --git a/application/hub/config.php b/application/hub/config.php index 89d2adfec..8d69b82e4 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -42,7 +42,7 @@ $cfg->setConfigEntry('boot_node_udp_listen_port', 9061); // CFG: NODE-DEFAULT-MODE (can be 'regular', 'list', 'master' or 'boot', default is 'regular') $cfg->setConfigEntry('node_default_mode', 'regular'); -// CFG: CRUNCHER-DEFAULT-MODE (can be 'mcrypt' at the moment) +// CFG: CRUNCHER-DEFAULT-MODE (can be only 'mcrypt' at the moment) $cfg->setConfigEntry('cruncher_default_mode', 'mcrypt'); // CFG: TEMPLATE-ENGINE @@ -171,6 +171,15 @@ $cfg->setConfigEntry('node_activation_task_handler_initializer_filter', 'NodeTas // CFG: CRUNCHER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER $cfg->setConfigEntry('cruncher_bootstrap_task_handler_initializer_filter', 'CruncherTaskHandlerInitializerFilter'); +// CFG: CRUNCHER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER +$cfg->setConfigEntry('cruncher_bootstrap_extra_bootstrapping_filter', 'CruncherBootstrapExtraBootstrappingFilter'); + +// CFG: CRUNCHER-BOOTSTRAP-BUFFER-QUEUE-INITIALIZER-FILTER +$cfg->setConfigEntry('cruncher_bootstrap_buffer_queue_initializer_filter', 'CruncherBootstrapBufferQueueInitializerFilter'); + +// CFG: CRUNCHER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER +$cfg->setConfigEntry('cruncher_bootstrap_generic_activation_filter', 'CruncherBootstrapGenericActivationFilter'); + // CFG: NODE-ACTIVATION-SELF-ANNOUNCEMENT-TASK-FILTER $cfg->setConfigEntry('node_activation_self_announcement_task_filter', 'NodeActivationSelfAnnouncementFilter'); @@ -192,8 +201,8 @@ $cfg->setConfigEntry('node_bootstrap_restore_nodelist_filter', 'NodeBootstrapRes // CFG: NODE-BOOTSTRAP-INIT-QUEUES-FILTER $cfg->setConfigEntry('node_bootstrap_init_queues_filter', 'NodeBootstrapInitQueuesFilter'); -// CFG: NODE-BOOTSTRAP-EXTRA-BOOTSTRAP-FILTER -$cfg->setConfigEntry('node_bootstrap_extra_bootstrap_filter', 'NodeBootstrapExtraBootstrappingFilter'); +// CFG: NODE-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER +$cfg->setConfigEntry('node_bootstrap_extra_bootstrapping_filter', 'NodeBootstrapExtraBootstrappingFilter'); // CFG: NODE-BOOTSTRAP-LISTENER-POOL-FILTER $cfg->setConfigEntry('node_bootstrap_listener_pool_filter', 'NodeBootstrapListenerPoolFilter'); @@ -261,6 +270,9 @@ $cfg->setConfigEntry('code_template_type', 'xml'); // CFG: PACKAGE-STACKER-CLASS $cfg->setConfigEntry('package_stacker_class', 'FiFoStacker'); +// CFG: CRUNCHER-BUFFER-STACKER-CLASS +$cfg->setConfigEntry('cruncher_buffer_stacker_class', 'FiFoStacker'); + // CFG: STACKER-ANNOUNCEMENT-MAX-SIZE $cfg->setConfigEntry('stacker_announcement_max_size', 20); @@ -276,6 +288,12 @@ $cfg->setConfigEntry('stacker_declared_max_size', 1000); // CFG: STACKER-OUTGOING-MAX-SIZE $cfg->setConfigEntry('stacker_outgoing_max_size', 100); +// CFG: STACKER-IN-QUEUE-MAX-SIZE +$cfg->setConfigEntry('stacker_in_queue_max_size', 10000); + +// CFG: STACKER-OUT-QUEUE-MAX-SIZE +$cfg->setConfigEntry('stacker_out_queue_max_size', 10000); + // CFG: STACKER-OBJECT-REGISTRY-MAX-SIZE $cfg->setConfigEntry('stacker_object_registry_max_size', 100); @@ -375,6 +393,9 @@ $cfg->setConfigEntry('hub_self_announcement_task_class', 'HubSelfAnnouncementTas // CFG: HUB-PACKAGE-WRITER-TASK-CLASS $cfg->setConfigEntry('hub_package_writer_task_class', 'NetworkPackageWriterTask'); +// CFG: CRUNCHER-WORK-UNIT-FETCHER-TASK-CLASS +$cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'CruncherWorkUnitFetcherTask'); + // CFG: TASK-NETWORK-PACKAGE-WRITER-STARTUP-DELAY $cfg->setConfigEntry('task_network_package_writer_startup_delay', 2500); @@ -384,6 +405,15 @@ $cfg->setConfigEntry('task_network_package_writer_interval_delay', 10); // CFG: TASK-NETWORK-PACKAGE-WRITER-MAX-RUNS $cfg->setConfigEntry('task_network_package_writer_max_runs', 0); +// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-STARTUP-DELAY +$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_startup_delay', 1000); + +// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-INTERVAL-DELAY +$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_interval_delay', 10); + +// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-MAX-RUNS +$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_max_runs', 0); + // CFG: TASK-LIST-CLASS $cfg->setConfigEntry('task_list_class', 'TaskList'); @@ -480,5 +510,11 @@ $cfg->setConfigEntry('external_ip', ''); // CFG: PACKAGE-FRAGMENTER-CLASS $cfg->setConfigEntry('package_fragmenter_class', 'PackageFragmenter'); +// CFG: CRUNCHER-ALLOW-TEST-WORK-UNITS +$cfg->setConfigEntry('cruncher_allow_test_units', 'Y'); + +// CFG: CRUNCHER-IN-BUFFER-MIN-THRESHOLD +$cfg->setConfigEntry('cruncher_in_buffer_min_threshold', 3); + // [EOF] ?> diff --git a/application/hub/data.php b/application/hub/data.php index be91c6659..6e8b67cc0 100644 --- a/application/hub/data.php +++ b/application/hub/data.php @@ -43,9 +43,9 @@ $app = call_user_func_array( ); // Set application name and version -$app->setAppName("Generic Object Sharing Hub"); -$app->setAppVersion("0.0.0"); -$app->setAppShortName("hub"); +$app->setAppName('Generic Object Sharing Hub'); +$app->setAppVersion('0.0.0'); +$app->setAppShortName('hub'); // [EOF] ?> diff --git a/application/hub/init.php b/application/hub/init.php index b3cd98935..b6e439545 100644 --- a/application/hub/init.php +++ b/application/hub/init.php @@ -38,12 +38,6 @@ $cfg = FrameworkConfiguration::getInstance(); // Initialize output system require($cfg->getConfigEntry('base_path') . 'inc/output.php'); -// Initialize file i/o system -require($cfg->getConfigEntry('base_path') . 'inc/file_io.php'); - -// Include the language sub-system -require($cfg->getConfigEntry('base_path') . 'inc/language.php'); - // This application needs a database connection then we have to simply include // the inc/database.php script require($cfg->getConfigEntry('base_path') . 'inc/database.php'); diff --git a/application/hub/interfaces/cruncher/class_CruncherHelper.php b/application/hub/interfaces/cruncher/class_CruncherHelper.php index 3aaf7bb43..68b791d11 100644 --- a/application/hub/interfaces/cruncher/class_CruncherHelper.php +++ b/application/hub/interfaces/cruncher/class_CruncherHelper.php @@ -32,6 +32,15 @@ interface CruncherHelper extends FrameworkInterface { */ function doBootstrapping (); + /** + * This method determines if the in-buffer is going to depleted and if so, + * it fetches more WUs from the network. If no WU can be fetched from the + * network and if enabled, a random test WU is being generated. + * + * @return void + */ + function doFetchWorkUnits (); + /** * Outputs the console teaser. This should only be executed on startup or * full restarts. This method generates some space around the teaser. @@ -43,9 +52,33 @@ interface CruncherHelper extends FrameworkInterface { /** * Add some cruncher-specific filters * + * @param $controllerInstance An object of a Controller instance + * @param $responseInstance An object of a Responseable instance + * @return void + */ + function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance); + + /** + * Enables/disables the cruncher (just sets a flag) + * + * @param $version Version number of this cruncher + * @return void + */ + function enableIsActive ($isActive = true); + + /** + * Determines wether the cruncher is active + * + * @return $isActive Wether the cruncher is active + */ + function isActive (); + + /** + * Initializes all buffer queues (mostly in/out) + * * @return void */ - function addExtraCruncherFilters (); + function initBufferQueues (); } // [EOF] diff --git a/application/hub/interfaces/package/fragmenter/class_Fragmentable.php b/application/hub/interfaces/package/fragmenter/class_Fragmentable.php index e2336c4c3..b511efd66 100644 --- a/application/hub/interfaces/package/fragmenter/class_Fragmentable.php +++ b/application/hub/interfaces/package/fragmenter/class_Fragmentable.php @@ -31,7 +31,7 @@ interface Fragmentable extends FrameworkInterface { * @param $connectionInstance A helper instance for connections * @return void */ - function fragmentPackageArray (array $packageData, BaseconnectionInstance $connectionInstance); + function fragmentPackageArray (array $packageData, BaseConnectionHelper $connectionInstance); /** * This method gets the next chunk from the internal FIFO which should be diff --git a/application/hub/main/commands/console/class_HubConsoleCruncherCommand.php b/application/hub/main/commands/console/class_HubConsoleCruncherCommand.php index 21743bd64..d62a939d5 100644 --- a/application/hub/main/commands/console/class_HubConsoleCruncherCommand.php +++ b/application/hub/main/commands/console/class_HubConsoleCruncherCommand.php @@ -61,10 +61,12 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable { // Get a registry and the application instance from it $applicationInstance = Registry::getRegistry()->getInstance('app'); - // ----------------------- Bootstrapping phase ------------------------ - // Try to bootstrap the node and pass the request instance to it for - // extra arguments which mostly override config entries or enable special - // features within the hub (none is ready at this development stage) + /* + * ----------------------- Bootstrapping phase ------------------------ + * Try to bootstrap the node and pass the request instance to it for + * extra arguments which mostly override config entries or enable special + * features within the hub (none is ready at this development stage) + */ $this->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); $this->debugOutput('BOOTSTRAP: Bootstrap finished.'); @@ -72,20 +74,19 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable { // Get cruncher instance $cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); - // Add some cruncher-specific filters, e.g. announcement - $cruncherInstance->addExtraCruncherFilters(); - // Get task handler instance $handlerInstance = Registry::getRegistry()->getInstance('task'); // Debug message $this->debugOutput('MAIN: --- Entering main loop. ---'); - // ----------------------------- Main loop ---------------------------- - // This is the main loop. Queried calls should come back here very fast - // so the whole application runs on nice speed. This while-loop goes - // until the cruncher is no longer active or all tasks are killed. - while ($handlerInstance->hasTasksLeft()) { + /* + * ----------------------------- Main loop ---------------------------- + * This is the main loop. Queried calls should come back here very fast + * so the whole application runs on nice speed. This while-loop goes + * until the cruncher is no longer active or all tasks are killed. + */ + while (($cruncherInstance->isActive()) && ($handlerInstance->hasTasksLeft())) { // Handle all tasks here $handlerInstance->handleTasks(); } // END - while @@ -110,12 +111,16 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable { // Add bootstrap filters $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_task_handler_initializer_filter')); - //$controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_generate_nodeid_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_extra_bootstrapping_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_buffer_queue_initializer_filter')); + + // This is the last generic boostrap filter + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_generic_activation_filter')); // Add shutdown filters //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_task_handler_filter')); - // This is the last generic filter + // This is the last generic shutdown filter $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_cruncher_filter')); } } diff --git a/application/hub/main/commands/console/class_HubConsoleMainCommand.php b/application/hub/main/commands/console/class_HubConsoleMainCommand.php index e9140aa8b..f6af44969 100644 --- a/application/hub/main/commands/console/class_HubConsoleMainCommand.php +++ b/application/hub/main/commands/console/class_HubConsoleMainCommand.php @@ -61,10 +61,12 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { // Get a registry and the application instance from it $applicationInstance = Registry::getRegistry()->getInstance('app'); - // ----------------------- Bootstrapping phase ------------------------ - // Try to bootstrap the node and pass the request instance to it for - // extra arguments which mostly override config entries or enable special - // features within the hub (none is ready at this development stage) + /* + * ----------------------- Bootstrapping phase ------------------------ + * Try to bootstrap the node and pass the request instance to it for + * extra arguments which mostly override config entries or enable special + * features within the hub (none is ready at this development stage) + */ $this->debugOutput('BOOTSTRAP: Beginning with bootstrap...'); $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance); $this->debugOutput('BOOTSTRAP: Bootstrap finished.'); @@ -75,9 +77,11 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { // Add some node-specific filters, e.g. announcement $nodeInstance->addExtraNodeFilters(); - // -------------------------- Hub activation -------------------------- - // Activates the hub by doing some final preparation steps and setting - // the attribute $hubIsActive to true + /* + * -------------------------- Hub activation -------------------------- + * Activates the hub by doing some final preparation steps and setting + * the attribute $hubIsActive to true + */ $nodeInstance->activateNode($requestInstance, $responseInstance); // Get task handler instance @@ -86,10 +90,12 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { // Debug message $this->debugOutput('MAIN: --- Entering main loop. ---'); - // ----------------------------- Main loop ---------------------------- - // This is the main loop. Queried calls should come back here very fast - // so the whole application runs on nice speed. This while-loop goes - // until the hub is no longer active or all tasks are killed. + /* + * ----------------------------- Main loop ---------------------------- + * This is the main loop. Queried calls should come back here very fast + * so the whole application runs on nice speed. This while-loop goes + * until the hub is no longer active or all tasks are killed. + */ while (($nodeInstance->getIsActive()) && ($handlerInstance->hasTasksLeft())) { // Handle all tasks here $handlerInstance->handleTasks(); @@ -118,7 +124,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_sessionid_filter')); $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_restore_nodelist_filter')); $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_init_queues_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_extra_bootstrap_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_extra_bootstrapping_filter')); $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_listener_pool_filter')); // Add hub activation filters @@ -129,7 +135,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_deinit_queues_filter')); $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_task_handler_filter')); - // This is the last generic filter + // This is the last generic shutdown filter $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_node_filter')); } } diff --git a/application/hub/main/cruncher/class_BaseHubCruncher.php b/application/hub/main/cruncher/class_BaseHubCruncher.php index 60ef0cb34..54c5c3dec 100644 --- a/application/hub/main/cruncher/class_BaseHubCruncher.php +++ b/application/hub/main/cruncher/class_BaseHubCruncher.php @@ -27,6 +27,16 @@ class BaseHubCruncher extends BaseHubSystem implements Updateable { */ private $version = 'x.x'; + /** + * By default no cruncher is active + */ + private $isActive = false; + + /** + * All buffer queue instances (a FIFO) + */ + private $bufferInstance = null; + /** * Protected constructor * @@ -57,6 +67,60 @@ class BaseHubCruncher extends BaseHubSystem implements Updateable { $this->version = (string) $version; } + /** + * Checks wether the in-buffer queue is filled by comparing it's current + * amount of entries against a threshold. + * + * @return $isFilled Wether the in-buffer is filled + */ + protected function isInBufferQueueFilled () { + // Determine it + $isFilled = ($this->bufferInstance->getStackCount('in_queue') > $this->getConfigInstance()->getConfigEntry('cruncher_in_buffer_min_threshold')); + + // And return the result + return $isFilled; + } + + /** + * Enables/disables the cruncher (just sets a flag) + * + * @param $version Version number of this cruncher + * @return void + */ + public final function enableIsActive ($isActive = true) { + $this->isActive = (bool) $isActive; + } + + /** + * Determines wether the cruncher is active + * + * @return $isActive Wether the cruncher is active + */ + public final function isActive () { + return $this->isActive; + } + + /** + * Initializes all buffer queues (mostly in/out), this method is demanded + * by the CruncherHelper interface. + * + * @return void + */ + public function initBufferQueues () { + /* + * Initialize both buffer queues, we can use the FIFO class here + * directly and encapsulate its method calls with protected methods. + */ + $this->bufferInstance = ObjectFactory::createObjectByConfiguredName('cruncher_buffer_stacker_class'); + + // Initialize common stackers, like in/out + $this->bufferInstance->initStacker('in_queue'); + $this->bufferInstance->initStacker('out_queue'); + + // Output debug message + $this->debugOutput('CRUNCHER: All buffers are now initialized.'); + } + /** * Updates a given field with new value * diff --git a/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php b/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php index d23236d86..c31309971 100644 --- a/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php +++ b/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php @@ -54,18 +54,37 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis /** * Method to "bootstrap" the cruncher. This step does also apply provided - * command-line arguments stored in the request instance. The regular cruncher - * should communicate with the bootstrap-crunchers at this point. + * command-line arguments stored in the request instance. No buffer queue + * will be initialized here, we do only "general" things here. * * @return void * @todo Implement this method */ public function doBootstrapping () { - // Call generic (parent) bootstrapping method first - parent::doGenericBootstrapping(); $this->partialStub('Please implement this method.'); } + /** + * This method determines if the in-buffer is going to depleted and if so, + * it fetches more WUs from the network. If no WU can be fetched from the + * network and if enabled, a random test WU is being generated. + * + * @return void + */ + public function doFetchWorkUnits () { + // Simply check if we have enough WUs left in the in-buffer queue (a FIFO) + if (!$this->isInBufferQueueFilled()) { + // The in-buffer queue needs filling, so head out and get some work + $this->fillInBufferQueueWithWorkUnits(); + + // Is the buffer still not filled and are test-packages allowed? + if ((!$this->isInBufferQueueFilled()) && ($this->getConfigInstance()->getConfigEntry('cruncher_allow_test_units') == 'Y')) { + // Then fill the in-buffer with (one) test-unit(s) + $this->fillInBufferQueueWithTestUnits(); + } // END - if + } // END - if + } + /** * Outputs the console teaser. This should only be executed on startup or * full restarts. This method generates some space around the teaser. @@ -76,7 +95,7 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis // Output all lines $this->debugOutput(' '); $this->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...'); - $this->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2011 Hub Developer Team'); + $this->debugOutput('Copyright (c) 2011 MCrypt Cruncher Developer Team'); $this->debugOutput(' '); $this->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); $this->debugOutput('This is free software, and you are welcome to redistribute it under certain'); @@ -87,11 +106,14 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis /** * Add some cruncher-specific filters * + * @param $controllerInstance An object of a Controller instance + * @param $responseInstance An object of a Responseable instance * @return void * @todo 0% done */ - public function addExtraCruncherFilters () { + public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) { // Add some filters here + $this->partialStub('Please add some cruncher-specific filters, if required.'); } } diff --git a/application/hub/main/cruncher/test/class_HubMcryptCruncher.php b/application/hub/main/cruncher/test/class_HubMcryptCruncher.php deleted file mode 100644 index f551ef47b..000000000 --- a/application/hub/main/cruncher/test/class_HubMcryptCruncher.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/application/hub/main/cruncher/test/class_HubTestCruncher.php b/application/hub/main/cruncher/test/class_HubTestCruncher.php deleted file mode 100644 index f551ef47b..000000000 --- a/application/hub/main/cruncher/test/class_HubTestCruncher.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap index b5541131c..8f77e8ab7 100644 --- a/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap +++ b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap @@ -1,6 +1,6 @@ * @version 0.0.0 diff --git a/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapBufferQueueInitializerFilter.php b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapBufferQueueInitializerFilter.php new file mode 100644 index 000000000..7a5fd80a7 --- /dev/null +++ b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapBufferQueueInitializerFilter.php @@ -0,0 +1,66 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Cruncher 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 . + */ +class CruncherBootstrapBufferQueueInitializerFilter 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 createCruncherBootstrapBufferQueueInitializerFilter () { + // Get a new instance + $filterInstance = new CruncherBootstrapBufferQueueInitializerFilter(); + + // 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 cruncher instance + $cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); + + // Init all buffer queues + $cruncherInstance->initBufferQueues(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php index 17deffef9..ca55ffd81 100644 --- a/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php +++ b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapExtraBootstrappingFilter.php @@ -1,6 +1,6 @@ * @version 0.0.0 diff --git a/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php new file mode 100644 index 000000000..7b126431f --- /dev/null +++ b/application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php @@ -0,0 +1,69 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub 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 . + */ +class CruncherBootstrapGenericActivationFilter 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 createCruncherBootstrapGenericActivationFilter () { + // Get a new instance + $filterInstance = new CruncherBootstrapGenericActivationFilter(); + + // 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 Maybe we want to do somthing more here? + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get a cruncher instance + $cruncherInstance = Registry::getRegistry()->getInstance('cruncher'); + + // Set the flag + $cruncherInstance->enableIsActive(); + + // Debug message + $this->debugOutput('BOOTSTRAP: The cruncher has been activated.'); + } +} + +// [EOF] +?> diff --git a/application/hub/main/filter/cruncher/class_CruncherInitializationFilter.php b/application/hub/main/filter/cruncher/class_CruncherInitializationFilter.php index 1c6c9af29..f33ff1d59 100644 --- a/application/hub/main/filter/cruncher/class_CruncherInitializationFilter.php +++ b/application/hub/main/filter/cruncher/class_CruncherInitializationFilter.php @@ -75,13 +75,13 @@ class CruncherInitializationFilter extends BaseFilter implements Filterable { $cruncherInstance = ObjectFactory::createObjectByName($className, array($requestInstance)); // Get a registry - $appInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = Registry::getRegistry()->getInstance('app'); // Set the app instance - $cruncherInstance->setApplicationInstance($appInstance); + $cruncherInstance->setApplicationInstance($applicationInstance); // Add cruncher-specific filters - $cruncherInstance->addExtraFilters($requestInstance, $responseInstance); + $cruncherInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance); } catch (ClassNotFoundException $e) { // This exception means, the cruncher mode is invalid. // @TODO Can we rewrite this to app_die() ? diff --git a/application/hub/main/filter/node/class_NodeInitializationFilter.php b/application/hub/main/filter/node/class_NodeInitializationFilter.php index 4abb7d99e..8b90f65fd 100644 --- a/application/hub/main/filter/node/class_NodeInitializationFilter.php +++ b/application/hub/main/filter/node/class_NodeInitializationFilter.php @@ -75,13 +75,13 @@ class NodeInitializationFilter extends BaseFilter implements Filterable { $nodeInstance = ObjectFactory::createObjectByName($className, array($requestInstance)); // Get a registry - $appInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = Registry::getRegistry()->getInstance('app'); // Set the app instance - $nodeInstance->setApplicationInstance($appInstance); + $nodeInstance->setApplicationInstance($applicationInstance); // Add node-specific filters - $nodeInstance->addExtraFilters($requestInstance, $responseInstance); + $nodeInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance); } catch (ClassNotFoundException $e) { // This exception means, the node mode is invalid. // @TODO Can we rewrite this to app_die() ? diff --git a/application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php b/application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php index 895223257..15152b2e7 100644 --- a/application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php +++ b/application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php @@ -52,7 +52,7 @@ class CruncherTaskHandlerInitializerFilter extends BaseFilter implements Filtera * @param $responseInstance An instance of a class with an Responseable interface * @return void * @throws FilterChainException If we need to interrupt the filter chain - * @todo 0% done + * @todo 5% done */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get cruncher instance @@ -61,6 +61,11 @@ class CruncherTaskHandlerInitializerFilter extends BaseFilter implements Filtera // Get a new task handler instance $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class'); + // Register all tasks: + // 1) A task for fetching WUs (work units) + $taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_work_unit_fetcher_task_class'); + $handlerInstance->registerTask('cruncher_work_unit_fetcher', $taskInstance); + // Put the task handler in registry Registry::getRegistry()->addInstance('task', $handlerInstance); } diff --git a/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php b/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php index 0d0a24989..1ae1a5af6 100644 --- a/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php +++ b/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php @@ -61,12 +61,6 @@ class NodeTaskHandlerInitializerFilter extends BaseFilter implements Filterable // Get a new task handler instance $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class'); - // Generate idle task - $taskInstance = ObjectFactory::createObjectByConfiguredName('idle_task_class'); - - // Register it as well - $handlerInstance->registerTask('idle_loop', $taskInstance); - // Network package reader, needs to be delayed a little $handlerInstance->registerTask('network_package_reader', $nodeInstance->getListenerPoolInstance()); diff --git a/application/hub/main/handler/tasks/class_TaskHandler.php b/application/hub/main/handler/tasks/class_TaskHandler.php index 7a267f9e3..02fd4b7c5 100644 --- a/application/hub/main/handler/tasks/class_TaskHandler.php +++ b/application/hub/main/handler/tasks/class_TaskHandler.php @@ -64,6 +64,10 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { // Output debug message $handlerInstance->debugOutput('TASK-HANDLER: Task handler initialized.'); + // Register the first (and generic) idle-loop task + $taskInstance = ObjectFactory::createObjectByConfiguredName('idle_task_class'); + $handlerInstance->registerTask('idle_loop', $taskInstance); + // Return the prepared instance return $handlerInstance; } diff --git a/application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php b/application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php index 87f35e7f2..a3a62ee9c 100644 --- a/application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php +++ b/application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php @@ -69,10 +69,10 @@ class HubDescriptorHelper extends BaseHubHelper implements HelpableHub { $this->debugOutput('HELPER: Starting with announcement to upper hubs...'); // Get the application instance - $appInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = Registry::getRegistry()->getInstance('app'); // Get a XML template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('announcement_template_class', array($appInstance)); + $templateInstance = ObjectFactory::createObjectByConfiguredName('announcement_template_class', array($applicationInstance)); // Disable language support $templateInstance->enableLanguageSupport(false); diff --git a/application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php b/application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php index dee29469c..9f11626ad 100644 --- a/application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php +++ b/application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php @@ -68,10 +68,10 @@ class HubSelfConnectHelper extends BaseHubHelper implements HelpableHub { $this->debugOutput('HELPER: Attempting self-connect...'); // Get the application instance - $appInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = Registry::getRegistry()->getInstance('app'); // Get a XML template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('self_connect_template_class', array($appInstance)); + $templateInstance = ObjectFactory::createObjectByConfiguredName('self_connect_template_class', array($applicationInstance)); // Disable language support $templateInstance->enableLanguageSupport(false); diff --git a/application/hub/main/package/fragmenter/class_PackageFragmenter.php b/application/hub/main/package/fragmenter/class_PackageFragmenter.php index 1d221578e..6d69683c2 100644 --- a/application/hub/main/package/fragmenter/class_PackageFragmenter.php +++ b/application/hub/main/package/fragmenter/class_PackageFragmenter.php @@ -57,7 +57,7 @@ class PackageFragmenter extends BaseFrameworkSystem implements Fragmentable { * @param $connectionInstance A helper instance for connections * @return void */ - public function fragmentPackageArray (array $packageData, BaseconnectionInstance $connectionInstance) { + public function fragmentPackageArray (array $packageData, BaseConnectionHelper $connectionInstance) { } /** diff --git a/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php b/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php index 5c7b74207..d5aba0fae 100644 --- a/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php +++ b/application/hub/main/resolver/command/console/class_HubConsoleCommandResolver.php @@ -39,12 +39,12 @@ class HubConsoleCommandResolver extends BaseCommandResolver implements CommandRe * Creates an instance of a HubConsole command resolver with a given default command * * @param $commandName The default command we shall execute - * @param $appInstance An instance of a manageable application helper class + * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared command resolver instance * @throws EmptyVariableException Thrown if default command is not set * @throws InvalidCommandException Thrown if default command is invalid */ - public static final function createHubConsoleCommandResolver ($commandName, ManageableApplication $appInstance) { + public static final function createHubConsoleCommandResolver ($commandName, ManageableApplication $applicationInstance) { // Create the new instance $resolverInstance = new HubConsoleCommandResolver(); @@ -58,7 +58,7 @@ class HubConsoleCommandResolver extends BaseCommandResolver implements CommandRe } // Set the application instance - $resolverInstance->setApplicationInstance($appInstance); + $resolverInstance->setApplicationInstance($applicationInstance); // Return the prepared instance return $resolverInstance; diff --git a/application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php b/application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php index 62030a930..0eaadb707 100644 --- a/application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php +++ b/application/hub/main/resolver/controller/console/class_HubConsoleControllerResolver.php @@ -39,12 +39,12 @@ class HubConsoleControllerResolver extends BaseControllerResolver implements Con * Creates an instance of a resolver class with a given command * * @param $controllerName The controller we shall resolve - * @param $appInstance An instance of a manageable application helper class + * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared controller resolver instance * @throws EmptyVariableException Thrown if default command is not set * @throws InvalidControllerException Thrown if default controller is invalid */ - public static final function createHubConsoleControllerResolver ($controllerName, ManageableApplication $appInstance) { + public static final function createHubConsoleControllerResolver ($controllerName, ManageableApplication $applicationInstance) { // Create the new instance $resolverInstance = new HubConsoleControllerResolver(); @@ -58,7 +58,7 @@ class HubConsoleControllerResolver extends BaseControllerResolver implements Con } // Set the application instance - $resolverInstance->setApplicationInstance($appInstance); + $resolverInstance->setApplicationInstance($applicationInstance); // Set command name $resolverInstance->setControllerName($controllerName); diff --git a/application/hub/main/tags/package/class_PackageTags.php b/application/hub/main/tags/package/class_PackageTags.php index e8e0b6a9f..f7aa8ff62 100644 --- a/application/hub/main/tags/package/class_PackageTags.php +++ b/application/hub/main/tags/package/class_PackageTags.php @@ -71,10 +71,10 @@ class PackageTags extends BaseTags implements Tagable { $this->debugOutput('TAGS: Initializing object registry - START'); // Get the application instance - $appInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = Registry::getRegistry()->getInstance('app'); // Get a XML template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('object_registry_template_class', array($appInstance)); + $templateInstance = ObjectFactory::createObjectByConfiguredName('object_registry_template_class', array($applicationInstance)); // Disable language support $templateInstance->enableLanguageSupport(false); diff --git a/application/hub/main/tasks/class_ b/application/hub/main/tasks/class_ index febfdb81e..ca9549023 100644 --- a/application/hub/main/tasks/class_ +++ b/application/hub/main/tasks/class_ @@ -1,6 +1,6 @@ * @version 0.0.0 @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ???Task extends BaseTask implements Taskable, Visitable { +class Cruncher???Task extends BaseTask implements Taskable, Visitable { /** * Protected constructor * @@ -37,9 +37,9 @@ class ???Task extends BaseTask implements Taskable, Visitable { * * @return $taskInstance An instance of a Visitable class */ - public final static function create???Task () { + public final static function createCruncher???Task () { // Get new instance - $taskInstance = new ???Task(); + $taskInstance = new Cruncher???Task(); // Return the prepared instance return $taskInstance; @@ -50,7 +50,7 @@ class ???Task extends BaseTask implements Taskable, Visitable { * * @param $visitorInstance An instance of a Visitor class * @return void - * @todo 0% + * @todo Maybe visit some sub-objects */ public function accept (Visitor $visitorInstance) { // Visit this task @@ -61,8 +61,9 @@ class ???Task extends BaseTask implements Taskable, Visitable { * Executes the task * * @return void + * @todo 0% */ - public function execute () { + public function executeTask () { $this->partialStub('Unimplemented task.'); } } diff --git a/application/hub/main/cruncher/test/.htaccess b/application/hub/main/tasks/cruncher/.htaccess similarity index 100% rename from application/hub/main/cruncher/test/.htaccess rename to application/hub/main/tasks/cruncher/.htaccess diff --git a/application/hub/main/tasks/cruncher/class_ b/application/hub/main/tasks/cruncher/class_ new file mode 100644 index 000000000..ca9549023 --- /dev/null +++ b/application/hub/main/tasks/cruncher/class_ @@ -0,0 +1,72 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub 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 . + */ +class Cruncher???Task extends BaseTask implements Taskable, Visitable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $taskInstance An instance of a Visitable class + */ + public final static function createCruncher???Task () { + // Get new instance + $taskInstance = new Cruncher???Task(); + + // Return the prepared instance + return $taskInstance; + } + + /** + * Accepts the visitor to process the visit "request" + * + * @param $visitorInstance An instance of a Visitor class + * @return void + * @todo Maybe visit some sub-objects + */ + public function accept (Visitor $visitorInstance) { + // Visit this task + $visitorInstance->visitTask($this); + } + + /** + * Executes the task + * + * @return void + * @todo 0% + */ + public function executeTask () { + $this->partialStub('Unimplemented task.'); + } +} + +// [EOF] +?> diff --git a/application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php b/application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php new file mode 100644 index 000000000..6b1181bda --- /dev/null +++ b/application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php @@ -0,0 +1,80 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub 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 . + */ +class CruncherWorkUnitFetcherTask extends BaseTask implements Taskable, Visitable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $taskInstance An instance of a Visitable class + */ + public final static function createCruncherWorkUnitFetcherTask () { + // Get new instance + $taskInstance = new CruncherWorkUnitFetcherTask(); + + // Return the prepared instance + return $taskInstance; + } + + /** + * Accepts the visitor to process the visit "request" + * + * @param $visitorInstance An instance of a Visitor class + * @return void + * @todo Maybe visit some sub-objects + */ + public function accept (Visitor $visitorInstance) { + // Visit this task + $visitorInstance->visitTask($this); + } + + /** + * Executes the task + * + * @return void + */ + public function executeTask () { + /* + * Get the cruncher instance and call a method which should check if + * the in-buffer is going to depleted. If so, new WUs are fetched from + * network or (if enabled in config) a random test WU is being + * generated. This test WU is for developing only or, if you like, to + * test your cruncher loop. + * + * Please report any bugs you encounter to me. + */ + Registry::getRegistry()->getInstance('cruncher')->doFetchWorkUnits(); + } +} + +// [EOF] +?> diff --git a/application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php b/application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php index 1a6143fe4..ccfdb498d 100644 --- a/application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php +++ b/application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php @@ -69,8 +69,8 @@ class AnnouncementTemplateEngine extends BaseTemplateEngine implements Compileab /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $appInstance A manageable application - * @return $templateInstance An instance of TemplateEngine + * @param $applicationInstance A manageable application + * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string * @throws BasePathIsNoDirectoryException If $templateBasePath is no @@ -78,16 +78,12 @@ class AnnouncementTemplateEngine extends BaseTemplateEngine implements Compileab * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ - public static final function createAnnouncementTemplateEngine (ManageableApplication $appInstance) { + public static final function createAnnouncementTemplateEngine (ManageableApplication $applicationInstance) { // Get a new instance $templateInstance = new AnnouncementTemplateEngine(); - // Get language and file I/O instances from application - $langInstance = $appInstance->getLanguageInstance(); - $ioInstance = $appInstance->getFileIoInstance(); - // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -107,10 +103,6 @@ class AnnouncementTemplateEngine extends BaseTemplateEngine implements Compileab // Set the base path $templateInstance->setTemplateBasePath($templateBasePath); - // Set the language and IO instances - $templateInstance->setLanguageInstance($langInstance); - $templateInstance->setFileIoInstance($ioInstance); - // Set template extensions $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension')); $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('announcement_template_extension')); diff --git a/application/hub/main/template/connect/class_SelfConnectTemplateEngine.php b/application/hub/main/template/connect/class_SelfConnectTemplateEngine.php index ca60f142e..5d33ef7fc 100644 --- a/application/hub/main/template/connect/class_SelfConnectTemplateEngine.php +++ b/application/hub/main/template/connect/class_SelfConnectTemplateEngine.php @@ -62,8 +62,8 @@ class SelfConnectTemplateEngine extends BaseTemplateEngine implements Compileabl /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $appInstance A manageable application - * @return $templateInstance An instance of TemplateEngine + * @param $applicationInstance A manageable application + * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string * @throws BasePathIsNoDirectoryException If $templateBasePath is no @@ -71,16 +71,12 @@ class SelfConnectTemplateEngine extends BaseTemplateEngine implements Compileabl * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ - public static final function createSelfConnectTemplateEngine (ManageableApplication $appInstance) { + public static final function createSelfConnectTemplateEngine (ManageableApplication $applicationInstance) { // Get a new instance $templateInstance = new SelfConnectTemplateEngine(); - // Get language and file I/O instances from application - $langInstance = $appInstance->getLanguageInstance(); - $ioInstance = $appInstance->getFileIoInstance(); - // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -100,10 +96,6 @@ class SelfConnectTemplateEngine extends BaseTemplateEngine implements Compileabl // Set the base path $templateInstance->setTemplateBasePath($templateBasePath); - // Set the language and IO instances - $templateInstance->setLanguageInstance($langInstance); - $templateInstance->setFileIoInstance($ioInstance); - // Set template extensions $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension')); $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('self_connect_template_extension')); diff --git a/application/hub/main/template/objects/class_ObjectRegistryTemplateEngine.php b/application/hub/main/template/objects/class_ObjectRegistryTemplateEngine.php index bd8a99c43..39f6be92e 100644 --- a/application/hub/main/template/objects/class_ObjectRegistryTemplateEngine.php +++ b/application/hub/main/template/objects/class_ObjectRegistryTemplateEngine.php @@ -74,8 +74,8 @@ class ObjectRegistryTemplateEngine extends BaseTemplateEngine implements Compile /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $appInstance A manageable application - * @return $templateInstance An instance of TemplateEngine + * @param $applicationInstance A manageable application + * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string * @throws BasePathIsNoDirectoryException If $templateBasePath is no @@ -83,16 +83,12 @@ class ObjectRegistryTemplateEngine extends BaseTemplateEngine implements Compile * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ - public static final function createObjectRegistryTemplateEngine (ManageableApplication $appInstance) { + public static final function createObjectRegistryTemplateEngine (ManageableApplication $applicationInstance) { // Get a new instance $templateInstance = new ObjectRegistryTemplateEngine(); - // Get language and file I/O instances from application - $langInstance = $appInstance->getLanguageInstance(); - $ioInstance = $appInstance->getFileIoInstance(); - // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -112,10 +108,6 @@ class ObjectRegistryTemplateEngine extends BaseTemplateEngine implements Compile // Set the base path $templateInstance->setTemplateBasePath($templateBasePath); - // Set the language and IO instances - $templateInstance->setLanguageInstance($langInstance); - $templateInstance->setFileIoInstance($ioInstance); - // Set template extensions $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension')); $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('object_registry_template_extension')); diff --git a/docs/TODOs.txt b/docs/TODOs.txt index ecdfbd6e5..3b0fc8c74 100644 --- a/docs/TODOs.txt +++ b/docs/TODOs.txt @@ -2,18 +2,21 @@ ### DO NOT EDIT THIS FILE. ### ./application/hub/interfaces/cruncher/class_CruncherHelper.php:10: * @todo We need to find a better name for this interface ./application/hub/interfaces/nodes/class_NodeHelper.php:10: * @todo We need to find a better name for this interface +./application/hub/main/commands/console/class_HubConsoleCruncherCommand.php:104: * @todo Should we add some more filters? ./application/hub/main/commands/console/class_HubConsoleCruncherCommand.php:58: * @todo Try to create a CruncherActivationTask or so -./application/hub/main/commands/console/class_HubConsoleCruncherCommand.php:97: * @todo Should we add some more filters? -./application/hub/main/commands/console/class_HubConsoleMainCommand.php:108: * @todo Should we add some more filters? +./application/hub/main/commands/console/class_HubConsoleMainCommand.php:114: * @todo Should we add some more filters? ./application/hub/main/commands/console/class_HubConsoleMainCommand.php:58: * @todo Try to create a HubActivationTask or so ./application/hub/main/connectors/query/local/class_LocalQueryConnector.php:10: * @todo Find an interface for: handleAllQueries() ./application/hub/main/connectors/query/local/class_LocalQueryConnector.php:78: * @TODO 0% done: Unfinished work here ./application/hub/main/connectors/queues/local/class_LocalQueueConnector.php:58: * @TODO 0% done: Unfinished work here -./application/hub/main/cruncher/class_BaseHubCruncher.php:43: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem -./application/hub/main/cruncher/test/class_HubTestCruncher.php:58: * @todo Implement this method +./application/hub/main/cruncher/class_BaseHubCruncher.php:131: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem +./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:112: * @todo 0% done +./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:61: * @todo Implement this method ./application/hub/main/discovery/socket/class_PackageSocketDiscovery.php:102: // @TODO We may need some locking here ./application/hub/main/factories/socket/class_SocketFactory.php:10: * @todo Find an interface for hub helper -./application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php:54: * @todo 0% done +./application/hub/main/filter/activation/node/class_NodeActivationSelfAnnouncementFilter.php:54: * @todo 0% done +./application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapBufferQueueInitializerFilter.php:54: * @todo 0% done +./application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrapGenericActivationFilter.php:54: * @todo Maybe we want to do somthing more here? ./application/hub/main/filter/cruncher/class_CruncherInitializationFilter.php:54: * @todo 0% done ./application/hub/main/filter/cruncher/class_CruncherInitializationFilter.php:87: // @TODO Can we rewrite this to app_die() ? ./application/hub/main/filter/cruncher/class_CruncherPhpRequirementsFilter.php:55: * @todo Add more test and try to add an extra message to the thrown exception @@ -22,14 +25,14 @@ ./application/hub/main/filter/node/class_NodeInitializationFilter.php:87: // @TODO Can we rewrite this to app_die() ? ./application/hub/main/filter/node/class_NodePhpRequirementsFilter.php:55: * @todo Add more test and try to add an extra message to the thrown exception ./application/hub/main/filter/node/class_NodeWelcomeTeaserFilter.php:55: * @todo Handle over the $responseInstance to outputConsoleTeaser() -./application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php:55: * @todo 0% done -./application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php:55: * @todo 0% done -./application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php:55: * @todo 0% done -./application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php:55: * @todo 0% done -./application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php:55: * @todo 0% done +./application/hub/main/filter/shutdown/node/class_NodeShutdownDeinitQueuesFilter.php:55: * @todo 0% done +./application/hub/main/filter/shutdown/node/class_NodeShutdownFlushNodeListFilter.php:55: * @todo 0% done +./application/hub/main/filter/shutdown/node/class_NodeShutdownTaskHandlerFilter.php:55: * @todo 0% done +./application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php:55: * @todo 5% done +./application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php:55: * @todo 0% done ./application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php:96: * @todo ~10% done ./application/hub/main/handler/network/udp/class_UdpNetworkPackageHandler.php:58: * @todo 0% -./application/hub/main/handler/tasks/class_TaskHandler.php:136: // @TODO Messurement can be added around this call +./application/hub/main/handler/tasks/class_TaskHandler.php:140: // @TODO Messurement can be added around this call ./application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php:10: * @todo Find an interface for hub helper ./application/hub/main/helper/connection/tcp/class_TcpConnectionHelper.php:139: * @todo We may want to implement a filter for ease notification of other objects like our pool ./application/hub/main/helper/connection/udp/class_UdpConnectionHelper.php:10: * @todo Find an interface for hub helper @@ -68,16 +71,17 @@ ./application/hub/main/pools/peer/class_DefaultPeerPool.php:148: // @TODO Check for IP ./application/hub/main/resolver/state/network/class_NetworkStateResolver.php:68: * @todo ~30% done ./application/hub/main/resolver/state/network/class_NetworkStateResolver.php:80: // @TODO On some systems it is 134, on some 107? +./application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php:53: * @todo Maybe visit some sub-objects ./application/hub/main/tasks/hub/announcement/class_HubSelfAnnouncementTask.php:53: * @todo 0% ./application/hub/main/tasks/hub/class_HubSelfConnectTask.php:53: * @todo 0% ./application/hub/main/tasks/hub/ping/class_HubPingTask.php:63: * @todo 0% ./application/hub/main/tasks/hub/update/class_HubUpdateCheckTask.php:53: * @todo 0% ./application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php:10: * @todo This template engine does not make use of setTemplateType() -./application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php:253: * @todo Find something useful with this! +./application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php:245: * @todo Find something useful with this! ./application/hub/main/template/connect/class_SelfConnectTemplateEngine.php:10: * @todo This template engine does not make use of setTemplateType() -./application/hub/main/template/connect/class_SelfConnectTemplateEngine.php:246: * @todo Find something useful with this! +./application/hub/main/template/connect/class_SelfConnectTemplateEngine.php:238: * @todo Find something useful with this! ./application/hub/main/template/objects/class_ObjectRegistryTemplateEngine.php:10: * @todo This template engine does not make use of setTemplateType() -./application/hub/main/template/objects/class_ObjectRegistryTemplateEngine.php:257: * @todo Find something useful with this! +./application/hub/main/template/objects/class_ObjectRegistryTemplateEngine.php:249: * @todo Find something useful with this! ./application/hub/main/tools/class_HubTools.php:128: // @TODO We may want to encapsulate this PHP call into an own class ./application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php:105: * @todo Does a query needs to perform some actions as an active task? ./application/hub/main/visitor/tasks/class_ActiveTaskVisitor.php:116: * @todo Does a queue needs to perform some actions as an active task? @@ -86,11 +90,11 @@ ./inc/classes/exceptions/main/class_MissingMethodException.php:13: * @todo Try to rewrite user/guest login classes and mark this exception as deprecated ./inc/classes/exceptions/main/class_NoConfigEntryException.php:10: * @todo Rename this class to NoFoundEntryException ./inc/classes/interfaces/class_FrameworkInterface.php:11: * @todo Find a better name for this interface -./inc/classes/main/class_BaseFrameworkSystem.php:1142: * @todo Write a logging mechanism for productive mode -./inc/classes/main/class_BaseFrameworkSystem.php:1156: // @TODO Finish this part! +./inc/classes/main/class_BaseFrameworkSystem.php:1133: * @todo Write a logging mechanism for productive mode +./inc/classes/main/class_BaseFrameworkSystem.php:1147: // @TODO Finish this part! ./inc/classes/main/class_BaseFrameworkSystem.php:154: // @todo Try to clean these constants up -./inc/classes/main/class_BaseFrameworkSystem.php:235: * @todo This is old code. Do we still need this old lost code? -./inc/classes/main/class_BaseFrameworkSystem.php:303: * @todo SearchableResult and UpdateableResult shall have a super interface to use here +./inc/classes/main/class_BaseFrameworkSystem.php:233: * @todo This is old code. Do we still need this old lost code? +./inc/classes/main/class_BaseFrameworkSystem.php:301: * @todo SearchableResult and UpdateableResult shall have a super interface to use here ./inc/classes/main/commands/web/class_WebLoginAreaCommand.php:64: * @todo Add some stuff here: Some personal data, app/game related data ./inc/classes/main/commands/web/class_WebProblemCommand.php:58: * @todo 0% done ./inc/classes/main/commands/web/class_WebStatusCommand.php:58: * @todo 0% done @@ -110,7 +114,7 @@ ./inc/classes/main/controller/web/class_WebStatusController.php:10: * @todo This controller shall still provide some headlines for sidebars ./inc/classes/main/criteria/search/class_SearchCriteria.php:114: * @todo Find a nice casting here. (int) allows until and including 32766. ./inc/classes/main/criteria/search/class_SearchCriteria.php:94: * @todo Find a nice casting here. (int) allows until and including 32766. -./inc/classes/main/database/databases/class_LocalFileDatabase.php:363: * @todo Do some checks on the database directory and files here +./inc/classes/main/database/databases/class_LocalFileDatabase.php:360: * @todo Do some checks on the database directory and files here ./inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php:426: * @todo Find something useful with this! ./inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php:82: * @todo 0% done ./inc/classes/main/filter/change/class_EmailChangeFilter.php:54: * @todo Implement email change of the user here. HINT: Use the User class! @@ -158,22 +162,22 @@ ./inc/classes/main/result/class_DatabaseResult.php:379:4 * @todo Find a caching way without modifying the result array ./inc/classes/main/rng/class_RandomNumberGenerator.php:150: * @todo I had a better random number generator here but now it is somewhere lost :( ./inc/classes/main/rng/class_RandomNumberGenerator.php:83: * @todo Add site key for stronger salt! -./inc/classes/main/template/class_BaseTemplateEngine.php:1049: // @TODO This silent abort should be logged, maybe. -./inc/classes/main/template/class_BaseTemplateEngine.php:1057: // @TODO Old behaviour, will become obsolete! -./inc/classes/main/template/class_BaseTemplateEngine.php:1060: // @TODO Yet another old way -./inc/classes/main/template/class_BaseTemplateEngine.php:1126: // @TODO This silent abort should be logged, maybe. -./inc/classes/main/template/class_BaseTemplateEngine.php:1147: * @todo Make this code some nicer... -./inc/classes/main/template/class_BaseTemplateEngine.php:955: * @todo Unfinished work or don't die here. -./inc/classes/main/template/class_BaseTemplateEngine.php:972: // @TODO Non-string found so we need some deeper analysis... +./inc/classes/main/template/class_BaseTemplateEngine.php:1055: // @TODO This silent abort should be logged, maybe. +./inc/classes/main/template/class_BaseTemplateEngine.php:1063: // @TODO Old behaviour, will become obsolete! +./inc/classes/main/template/class_BaseTemplateEngine.php:1066: // @TODO Yet another old way +./inc/classes/main/template/class_BaseTemplateEngine.php:1132: // @TODO This silent abort should be logged, maybe. +./inc/classes/main/template/class_BaseTemplateEngine.php:1153: * @todo Make this code some nicer... +./inc/classes/main/template/class_BaseTemplateEngine.php:961: * @todo Unfinished work or don't die here. +./inc/classes/main/template/class_BaseTemplateEngine.php:978: // @TODO Non-string found so we need some deeper analysis... ./inc/classes/main/template/console/class_ConsoleTemplateEngine.php:10: * @todo This template engine does not make use of setTemplateType() -./inc/classes/main/template/image/class_ImageTemplateEngine.php:221: * @todo Find something usefull with this! -./inc/classes/main/template/image/class_ImageTemplateEngine.php:241: * @todo Add cache creation here +./inc/classes/main/template/image/class_ImageTemplateEngine.php:213: * @todo Find something usefull with this! +./inc/classes/main/template/image/class_ImageTemplateEngine.php:233: * @todo Add cache creation here ./inc/classes/main/template/mail/class_MailTemplateEngine.php:10: * @todo This template engine does not make use of setTemplateType() -./inc/classes/main/template/mail/class_MailTemplateEngine.php:234: * @todo Add cache creation here -./inc/classes/main/template/mail/class_MailTemplateEngine.php:244: * @todo Should we call back the mailer class here? -./inc/classes/main/template/mail/class_MailTemplateEngine.php:325: * @todo 0% done -./inc/classes/main/template/menu/class_MenuTemplateEngine.php:273: * @todo Find something useful with this! -./inc/classes/main/template/menu/class_MenuTemplateEngine.php:319: * @todo Add cache creation here +./inc/classes/main/template/mail/class_MailTemplateEngine.php:226: * @todo Add cache creation here +./inc/classes/main/template/mail/class_MailTemplateEngine.php:236: * @todo Should we call back the mailer class here? +./inc/classes/main/template/mail/class_MailTemplateEngine.php:317: * @todo 0% done +./inc/classes/main/template/menu/class_MenuTemplateEngine.php:265: * @todo Find something useful with this! +./inc/classes/main/template/menu/class_MenuTemplateEngine.php:311: * @todo Add cache creation here ./inc/classes/main/user/class_BaseUser.php:308: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem ./inc/classes/main/user/class_BaseUser.php:80: * @todo Find a way of casting here. "(int)" might destroy the user id > 32766 ./inc/classes/main/user/member/class_Member.php:84: * @todo Add more ways over creating user classes @@ -182,34 +186,47 @@ ./inc/config/class_FrameworkConfiguration.php:172: * @todo We have to add some more entries from $_SERVER here ./inc/database.php:11: * @todo We should minimize these includes ./inc/database.php:51:// @TODO Rewrite this -./inc/file_io.php:13: * @todo We should minimize these includes ./inc/hooks.php:11: * @todo We should minimize these includes ./inc/hooks.php:28:// @TODO This makes the core depending on the SPL. But it should be installed anyway. ./inc/includes.php:11: * @todo We should minimize these includes ./inc/includes.php:38:// @TODO Find a nicer OOP-ed way for this -./inc/language.php:10: * @todo We should minimize these includes -./inc/language.php:33:// @TODO Rewrite this -./inc/loader/class_ClassLoader.php:262: /* @todo: Do not die here. */ +./inc/loader/class_ClassLoader.php:264: /* @todo: Do not die here. */ ./inc/output.php:11: * @todo We should minimize these includes ./inc/selector.php:11: * @todo We should minimize these includes ./index.php:59: * @todo This method is old code and needs heavy rewrite ### ### DEPRECATION FOLLOWS: ### ### +./application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter.php:2:// @DEPRECATED ./application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php:2:// @DEPRECATED +./application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php:2:// @DEPRECATED +./application/hub/main/filter/bootstrap/class_HubBootstrapGenerateHubIdFilter.php:2:// @DEPRECATED +./application/hub/main/filter/bootstrap/class_HubBootstrapGenerateSessionIdFilter.php:2:// @DEPRECATED ./application/hub/main/filter/bootstrap/class_HubBootstrapGenSessionIdFilter.php:2:// @DEPRECATED +./application/hub/main/filter/bootstrap/class_HubBootstrapInitQueuesFilter.php:2:// @DEPRECATED +./application/hub/main/filter/bootstrap/class_HubBootstrapListenerPoolFilter.php:2:// @DEPRECATED +./application/hub/main/filter/bootstrap/class_HubBootstrapRestoreNodeListFilter.php:2:// @DEPRECATED ./application/hub/main/filter/console/class_ConsoleWelcomeTeaserFilter.php:2:// @DEPRECATED +./application/hub/main/filter/shutdown/class_HubShutdownCruncherFilter.php:2:// @DEPRECATED +./application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php:2:// @DEPRECATED +./application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php:2:// @DEPRECATED ./application/hub/main/filter/shutdown/class_HubShutdownListenerPoolFilter.php:2:// @DEPRECATED +./application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php:2:// @DEPRECATED +./application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php:2:// @DEPRECATED +./application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php:2:// @DEPRECATED +./application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php:2:// @DEPRECATED ./application/hub/main/filter/task/class_TaskHandlerInitializerFilter.php:2:// @DEPRECATED ./application/hub/main/nodes/class_BaseHubNode.php:50: * @deprecated ./inc/classes/exceptions/io/class_FileNotFoundException.php:2:// @DEPRECATED ./inc/classes/exceptions/io/class_FilePointerNotOpenedException.php:2:// @DEPRECATED ./inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php:2:// @DEPRECATED +./inc/classes/exceptions/language/class_MissingFileIoHandlerException.php:2:// @DEPRECATED +./inc/classes/exceptions/language/class_MissingLanguageHandlerException.php:2:// @DEPRECATED ./inc/classes/exceptions/main/class_ClassNotFoundException.php:2:// @DEPRECATED ./inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php:2:// @DEPRECATED ./inc/classes.php:9: * @deprecated ./inc/database.php:10: * @deprecated -./inc/file_io.php:12: * @deprecated +./inc/file_io.php:2:// @DEPRECATED ./inc/hooks.php:10: * @deprecated ./inc/includes.php:10: * @deprecated -./inc/language.php:9: * @deprecated +./inc/language.php:2:// @DEPRECATED ./inc/output.php:10: * @deprecated ./inc/selector.php:10: * @deprecated diff --git a/index.php b/index.php index 0c60a2272..55bc413e5 100644 --- a/index.php +++ b/index.php @@ -121,15 +121,15 @@ final class ApplicationEntryPoint { } // END - foreach // Init application instance - $appInstance = null; + $applicationInstance = null; // Is the class there? if (class_exists('ApplicationHelper')) { // Get application instance - $appInstance = ApplicationHelper::getInstance(); + $applicationInstance = ApplicationHelper::getInstance(); // Assign application data - $templateInstance->assignApplicationData($appInstance); + $templateInstance->assignApplicationData($applicationInstance); } // END - if // We only try this -- 2.39.5