namespace Org\Mxchange\CoreFramework\Helper\Application;
// Import application-specific sutff
-use Org\Shipsimu\Hub\Tools\HubTools;
+//use Org\Shipsimu\Hub\Tools\HubTools;
// Import framework stuff
use Org\Mxchange\CoreFramework\Application\BaseApplication;
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0
- * @copyright Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2022 Hub Developer Team
+ * @copyright Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2022 LFDB2 Developer Team
* @license GNU GPL 3.0 or any newer version
*
* This program is free software: you can redistribute it and/or modify
*/
public function setupApplicationData () {
// Set all application data
- $this->setAppName('Generic Object Sharing Hub');
+ $this->setAppName('Local File Database 2');
$this->setAppVersion('0.0.0');
- $this->setAppShortName('hub');
+ $this->setAppShortName('lfdb2');
}
/**
FrameworkBootstrap::initDatabaseInstance();
// Get own internal address and set it in config
- $cfg->setConfigEntry('internal_address', HubTools::determineOwnInternalAddress());
+ $cfg->setConfigEntry('internal_address', lfdb2Tools::determineOwnInternalAddress());
}
/**
// Only for console requests as this is the actual daemon
if ($requestType == 'console') {
// -------------------------- Shutdown phase --------------------------
- // Shutting down the hub by saying "good bye" to all connected peers
- // and other hubs, flushing all queues and caches.
+ // Shutting down database system
self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown in progress, main loop exited.');
$this->getControllerInstance()->executeShutdownFilters($requestInstance, $responseInstance);
self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown completed. (This is the last line.)');
* ----------------------- Bootstrapping phase ------------------------
* Try to bootstrap the server 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)
+ * features within LFDB2 (none is ready at this development stage)
*/
self::createDebugInstance(__CLASS__)->debugOutput('BOOTSTRAP: Beginning with bootstrap...');
$applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance);
/*
* -------------------------- Server activation --------------------------
* Activates the server by doing some final preparation steps and setting
- * the attribute $hubIsActive to TRUE.
+ * the attribute $isActive to TRUE.
*/
$serverInstance->activateServer($requestInstance, $responseInstance);
* ----------------------------- Main loop ----------------------------
* This is the main server 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.
+ * until LFDB2 is no longer active or all tasks are killed.
*/
while (($serverInstance->isServerActive()) && ($handlerInstance->hasTasksLeft())) {
// Handle all tasks here
}
/**
- * Add a hub activation filter
+ * Add a LFDB2 activation filter
*
* @param $filterInstance A Filterable class
* @return void
}
/**
- * Executes all hub activation filters
+ * Executes all LFDB2 activation filters
*
* @param $requestInstance A Requestable class
* @param $responseInstance A Responseable class
<?php
/**
* A ShutdownServer filter for shutting down the server. This filter should be the
- * last one in 'shutdown' chain so the hub is shutted down at the very end of
- * its life... R.I.P. little hub...
+ * last one in 'shutdown' chain so the LFDB2 is shutted down at the very end of
+ * its life...
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-// Some hub-specific configuration like port hostname where we will listen, etc.
+// Some LFDB2-specific configuration like port hostname where we will listen, etc.
$cfg = FrameworkConfiguration::getSelfInstance();
// CFG: INTERNAL-ADDRESS
<?php
-/**
- * Application data
- *
- * Please remember that this include file is being loaded *before* the class
- * loader is loading classes from "exceptions", "interfaces" and "main"!
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.shipsimu.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/>.
- */
-
-// Get config instance
-$cfg = FrameworkConfiguration::getSelfInstance();
-
-// Get an instance of the helper
-$app = call_user_func_array(
- array($cfg->getConfigEntry('app_helper_class'), 'getSelfInstance'),
- array()
-);
-
-// Set application name and version
-$app->setAppName('Local File Database NG');
-$app->setAppVersion('0.0.0');
-$app->setAppShortName('lfdb2');
-
-// [EOF]
-?>
+// @DEPRECATED
<?php
/**
- * An include file for setting up the exception handler of the hub
+ * An include file for setting up the exception handler of the lfdb2
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0
*/
// The node's own exception handler
-function hub_exception_handler ($exceptionInstance) {
+function lfdb2_exception_handler ($exceptionInstance) {
// Is it an object and a valid instance?
if ((is_object($exceptionInstance)) && ($exceptionInstance instanceof FrameworkException)) {
// Init variable
//set_error_handler('__errorHandler');
// Set the new handler
-set_exception_handler('hub_exception_handler');
+set_exception_handler('lfdb2_exception_handler');
// Init assert handling
assert_options(ASSERT_ACTIVE , TRUE);
assert_options(ASSERT_BAIL , TRUE);
assert_options(ASSERT_QUIET_EVAL, FALSE);
assert_options(ASSERT_CALLBACK , '__assertHandler');
-
-// [EOF]
-?>
<?php
-/**
- * Application initializer
- *
- * Please remember that this include file is being loaded *before* the class
- * loader is loading classes from "exceptions", "interfaces" and "main"!
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0
- * @copyright Copyright (c) 2013 LFDB2 Developer Team
- * @license GNU GPL 3.0 or any newer version
- *
- * 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/>.
- */
-
-// Get config instance
-$cfg = FrameworkConfiguration::getSelfInstance();
-
-// Initialize output system
-ApplicationHelper::createDebugInstance('ApplicationHelper');
-
-// 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');
-
-// [EOF]
-?>
+// @DEPRECATED
<?php
-/**
- * The application's class loader
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0
- * @copyright Copyright (c) 2013 LFDB2 Developer Team
- * @license GNU GPL 3.0 or any newer version
- *
- * 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/>.
- */
-
-// Scan for application's classes, exceptions and interfaces
-ClassLoader::scanApplicationClasses();
-
-// [EOF]
-?>
+// @DEPRECATED
<?php
-/**
- * The application launcher
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.shipsimu.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/>.
- */
-
-// Is there an application helper instance? We need the method main() for
-// maining the application
-$app = call_user_func_array(
- array(
- FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class'), 'getSelfInstance'
- ), array()
-);
-
-// Some sanity checks
-if ((empty($app)) || (is_null($app))) {
- // Something went wrong!
- ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the helper class <span class=\"class_name\">%s</span> is not loaded.",
- $application,
- FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class')
- ));
-} elseif (!is_object($app)) {
- // No object!
- ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because 'app' is not an object.",
- $application
- ));
-} elseif (!method_exists($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method'))) {
- // Method not found!
- ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the method <span class=\"method_name\">%s</span> is missing.",
- $application,
- FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')
- ));
-}
-
-// Call user function
-call_user_func_array(array($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')), array());
-
-// [EOF]
-?>
+// @DEPRECATED