From: Roland Häder Date: Mon, 1 Jan 2018 07:13:20 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3b6880bb4c6fc2a73ab555b873c74124b569f4b6;p=city.git Continued: - "imported" classes/interfaces - getRequestInstance() is now moved to FrameworkBootstrap Signed-off-by: Roland Häder --- diff --git a/application/city/classes/actions/class_ b/application/city/classes/actions/class_ index 5b633e8..f1ebf1a 100644 --- a/application/city/classes/actions/class_ +++ b/application/city/classes/actions/class_ @@ -4,6 +4,7 @@ namespace Org\Mxchange\City\Action; // Import framework stuff use Org\Mxchange\CoreFramework\Controller\Controller; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; diff --git a/application/city/classes/actions/class_BaseCityAction.php b/application/city/classes/actions/class_BaseCityAction.php index 5384e9c..595c4d4 100644 --- a/application/city/classes/actions/class_BaseCityAction.php +++ b/application/city/classes/actions/class_BaseCityAction.php @@ -29,7 +29,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseCityAction extends BaseAction { +abstract class BaseCityAction extends BaseAction { /** * Protected constructor * diff --git a/application/city/classes/actions/html/city/class_HtmlCityLoginCityMapAction.php b/application/city/classes/actions/html/city/class_HtmlCityLoginCityMapAction.php index edddc0f..29f89cb 100644 --- a/application/city/classes/actions/html/city/class_HtmlCityLoginCityMapAction.php +++ b/application/city/classes/actions/html/city/class_HtmlCityLoginCityMapAction.php @@ -4,6 +4,7 @@ namespace Org\Mxchange\City\Action\Login; // Import framework stuff use Org\Mxchange\CoreFramework\Controller\Controller; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; diff --git a/application/city/classes/actions/html/class_HtmlCityLoginGovernmentAction.php b/application/city/classes/actions/html/class_HtmlCityLoginGovernmentAction.php index 227b36f..82ea314 100644 --- a/application/city/classes/actions/html/class_HtmlCityLoginGovernmentAction.php +++ b/application/city/classes/actions/html/class_HtmlCityLoginGovernmentAction.php @@ -4,6 +4,7 @@ namespace Org\Mxchange\City\Action\Login; // Import framework stuff use Org\Mxchange\CoreFramework\Controller\Controller; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; diff --git a/application/city/classes/actions/html/class_HtmlCityLoginLogoutAction.php b/application/city/classes/actions/html/class_HtmlCityLoginLogoutAction.php index 5ef2c49..c48aa8f 100644 --- a/application/city/classes/actions/html/class_HtmlCityLoginLogoutAction.php +++ b/application/city/classes/actions/html/class_HtmlCityLoginLogoutAction.php @@ -5,6 +5,7 @@ namespace Org\Mxchange\City\Action\Login; // Import framework stuff use Org\Mxchange\CoreFramework\Controller\Controller; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; diff --git a/application/city/classes/actions/html/class_HtmlCityLoginProfileAction.php b/application/city/classes/actions/html/class_HtmlCityLoginProfileAction.php index 9737fc8..e3ce288 100644 --- a/application/city/classes/actions/html/class_HtmlCityLoginProfileAction.php +++ b/application/city/classes/actions/html/class_HtmlCityLoginProfileAction.php @@ -4,6 +4,7 @@ namespace Org\Mxchange\City\Action\Login; // Import framework stuff use Org\Mxchange\CoreFramework\Controller\Controller; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; diff --git a/application/city/classes/actions/html/class_HtmlCityLoginStatusProblemAction.php b/application/city/classes/actions/html/class_HtmlCityLoginStatusProblemAction.php index f29a700..a86daf4 100644 --- a/application/city/classes/actions/html/class_HtmlCityLoginStatusProblemAction.php +++ b/application/city/classes/actions/html/class_HtmlCityLoginStatusProblemAction.php @@ -5,6 +5,7 @@ namespace Org\Mxchange\City\Action\Login; // Import framework stuff use Org\Mxchange\CoreFramework\Controller\Controller; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; diff --git a/application/city/classes/actions/html/class_HtmlCityLoginWelcomeAction.php b/application/city/classes/actions/html/class_HtmlCityLoginWelcomeAction.php index 5199c25..10dee40 100644 --- a/application/city/classes/actions/html/class_HtmlCityLoginWelcomeAction.php +++ b/application/city/classes/actions/html/class_HtmlCityLoginWelcomeAction.php @@ -4,6 +4,7 @@ namespace Org\Mxchange\City\Action\Login; // Import framework stuff use Org\Mxchange\CoreFramework\Controller\Controller; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; diff --git a/application/city/classes/city_daemon/class_ b/application/city/classes/city_daemon/class_ index 8e70ece..c9184eb 100644 --- a/application/city/classes/city_daemon/class_ +++ b/application/city/classes/city_daemon/class_ @@ -2,11 +2,12 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Simulation; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Helper\CityHelper; // Import framework stuff use Org\Mxchange\CoreFramework\Handler\Task\HandleableTask; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; /** diff --git a/application/city/classes/city_daemon/class_BaseCityDaemon.php b/application/city/classes/city_daemon/class_BaseCityDaemon.php index 9d7302a..6efac65 100644 --- a/application/city/classes/city_daemon/class_BaseCityDaemon.php +++ b/application/city/classes/city_daemon/class_BaseCityDaemon.php @@ -2,13 +2,17 @@ // Own namespace namespace Org\Mxchange\City\Daemon; -// Import own stuff +// Import application-specific stuff +use Org\Mxchange\City\Factory\State\CityStateFactory; use Org\Mxchange\City\Generic\BaseCitySystem; +use Org\Mxchange\City\Database\Frontend\Information\CityInformationDatabaseWrapper; // Import framework stuff +use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; use Org\Mxchange\CoreFramework\Criteria\Add\AddableCriteria; use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria; use Org\Mxchange\CoreFramework\Database\Updateable; +use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; @@ -36,7 +40,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseCityDaemon extends BaseCitySystem implements Updateable, AddableCriteria { +abstract class BaseCityDaemon extends BaseCitySystem implements Updateable, AddableCriteria { /** * City types */ @@ -99,7 +103,7 @@ class BaseCityDaemon extends BaseCitySystem implements Updateable, AddableCriter // Output all lines self::createDebugInstance(__CLASS__)->debugOutput(' '); - self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' daemon starting'); + self::createDebugInstance(__CLASS__)->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . FrameworkBootstrap::getRequestInstance()->getRequestElement('mode') . ' daemon starting'); self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2015, 2016 City Developer Team'); self::createDebugInstance(__CLASS__)->debugOutput(' '); self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); diff --git a/application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php b/application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php index 2820158..a21b9d5 100644 --- a/application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php +++ b/application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php @@ -2,13 +2,14 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Simulation; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\BaseCityDaemon; use Org\Mxchange\City\Helper\CityHelper; // Import framework stuff use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Handler\Task\HandleableTask; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; diff --git a/application/city/classes/class_ b/application/city/classes/class_ index 408811f..69af380 100644 --- a/application/city/classes/class_ +++ b/application/city/classes/class_ @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Generic\BaseCitySystem; /** diff --git a/application/city/classes/class_Base b/application/city/classes/class_Base index 2b83c98..a3c6bd4 100644 --- a/application/city/classes/class_Base +++ b/application/city/classes/class_Base @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Generic\BaseCitySystem; /** @@ -27,7 +27,7 @@ use Org\Mxchange\City\Generic\BaseCitySystem; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class Base??? extends BaseCitySystem { +abstract class Base??? extends BaseCitySystem { /** * Protected constructor * diff --git a/application/city/classes/class_BaseCitySystem.php b/application/city/classes/class_BaseCitySystem.php index f44083a..084a716 100644 --- a/application/city/classes/class_BaseCitySystem.php +++ b/application/city/classes/class_BaseCitySystem.php @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Generic; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Helper\CityHelper; // Import framework stuff @@ -30,7 +30,7 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseCitySystem extends BaseFrameworkSystem { +abstract class BaseCitySystem extends BaseFrameworkSystem { // Exception codes const EXCEPTION_UNSUPPORTED_ERROR_HANDLER = 0x900; const EXCEPTION_BASE64_ENCODING_NOT_MODULO_4 = 0x901; diff --git a/application/city/classes/commands/console/class_CityConsoleDaemonCommand.php b/application/city/classes/commands/console/class_CityConsoleDaemonCommand.php index 3262575..f2e006b 100644 --- a/application/city/classes/commands/console/class_CityConsoleDaemonCommand.php +++ b/application/city/classes/commands/console/class_CityConsoleDaemonCommand.php @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Command; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\Factory\CityDaemonFactory; // Import framework stuff diff --git a/application/city/classes/commands/html/class_CityHtmlLoginCommand.php b/application/city/classes/commands/html/class_CityHtmlLoginCommand.php index 6ecbf29..a347217 100644 --- a/application/city/classes/commands/html/class_CityHtmlLoginCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlLoginCommand.php @@ -6,6 +6,7 @@ namespace Org\Mxchange\City\Command; use Org\Mxchange\CoreFramework\Command\BaseCommand; use Org\Mxchange\CoreFramework\Command\Commandable; use Org\Mxchange\CoreFramework\Controller\Controller; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver; use Org\Mxchange\CoreFramework\Response\Responseable; diff --git a/application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php b/application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php index 8db2bbb..9654293 100644 --- a/application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php +++ b/application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php @@ -2,12 +2,14 @@ // Own namespace namespace Org\Mxchange\City\Database\Frontend\Information; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\BaseCityDaemon; use Org\Mxchange\City\Helper\CityHelper; // Import framework stuff +use Org\Mxchange\CoreFramework\Database\Frontend\BaseDatabaseWrapper; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; diff --git a/application/city/classes/database/frontend/city_entities/districts/class_CityDistrictsDatabaseWrapper.php b/application/city/classes/database/frontend/city_entities/districts/class_CityDistrictsDatabaseWrapper.php index 0ebb871..b7722a6 100644 --- a/application/city/classes/database/frontend/city_entities/districts/class_CityDistrictsDatabaseWrapper.php +++ b/application/city/classes/database/frontend/city_entities/districts/class_CityDistrictsDatabaseWrapper.php @@ -3,7 +3,9 @@ namespace Org\Mxchange\City\Database\Frontend\Districts; // Import framework stuff +use Org\Mxchange\CoreFramework\Database\Frontend\BaseDatabaseWrapper; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\Registerable; /** * A database wrapper for city districts diff --git a/application/city/classes/database/frontend/city_entities/lots/class_CityLotsDatabaseWrapper.php b/application/city/classes/database/frontend/city_entities/lots/class_CityLotsDatabaseWrapper.php index f615df5..9f07157 100644 --- a/application/city/classes/database/frontend/city_entities/lots/class_CityLotsDatabaseWrapper.php +++ b/application/city/classes/database/frontend/city_entities/lots/class_CityLotsDatabaseWrapper.php @@ -3,7 +3,9 @@ namespace Org\Mxchange\City\Database\Frontend\Lots; // Import framework stuff +use Org\Mxchange\CoreFramework\Database\Frontend\BaseDatabaseWrapper; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\Registerable; /** * A database wrapper for city lots diff --git a/application/city/classes/database/frontend/city_entities/sections/class_CitySectionsDatabaseWrapper.php b/application/city/classes/database/frontend/city_entities/sections/class_CitySectionsDatabaseWrapper.php index 604cf46..c7a07c3 100644 --- a/application/city/classes/database/frontend/city_entities/sections/class_CitySectionsDatabaseWrapper.php +++ b/application/city/classes/database/frontend/city_entities/sections/class_CitySectionsDatabaseWrapper.php @@ -3,7 +3,9 @@ namespace Org\Mxchange\City\Database\Frontend\Sections; // Import framework stuff +use Org\Mxchange\CoreFramework\Database\Frontend\BaseDatabaseWrapper; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\Registerable; /** * A database wrapper for city sections. Sections are the smalles entity of a diff --git a/application/city/classes/database/frontend/game_options/class_CityGameOptionsDatabaseWrapper.php b/application/city/classes/database/frontend/game_options/class_CityGameOptionsDatabaseWrapper.php index 9eb3294..4250491 100644 --- a/application/city/classes/database/frontend/game_options/class_CityGameOptionsDatabaseWrapper.php +++ b/application/city/classes/database/frontend/game_options/class_CityGameOptionsDatabaseWrapper.php @@ -1,4 +1,11 @@ . */ -class BaseCityFilter extends BaseFilter { +abstract class BaseCityFilter extends BaseFilter { /** * Array with all data XML nodes (which hold the actual data) and their values */ diff --git a/application/city/classes/filter/shutdown/city/class_CityDaemonShutdown b/application/city/classes/filter/shutdown/city/class_CityDaemonShutdown index 5a7cdc0..59333c9 100644 --- a/application/city/classes/filter/shutdown/city/class_CityDaemonShutdown +++ b/application/city/classes/filter/shutdown/city/class_CityDaemonShutdown @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Filter\Shutdown; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Filter\BaseCityFilter; // Import framework stuff diff --git a/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownCityFilter.php b/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownCityFilter.php index 72e5d1e..ed37106 100644 --- a/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownCityFilter.php +++ b/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownCityFilter.php @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Filter\Shutdown; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\Factory\CityDaemonFactory; use Org\Mxchange\City\Filter\BaseCityFilter; diff --git a/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php b/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php index d61e4a0..0edc4bc 100644 --- a/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php +++ b/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Filter\Shutdown; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Filter\BaseCityFilter; // Import framework stuff diff --git a/application/city/classes/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php b/application/city/classes/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php index 1ad38df..8e73df1 100644 --- a/application/city/classes/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php +++ b/application/city/classes/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Filter\Initialization\Tasks; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\Factory\CityDaemonFactory; use Org\Mxchange\City\Filter\BaseCityFilter; diff --git a/application/city/classes/filter/verifier/class_CityNameVerifierFilter.php b/application/city/classes/filter/verifier/class_CityNameVerifierFilter.php index c2ab884..816badc 100644 --- a/application/city/classes/filter/verifier/class_CityNameVerifierFilter.php +++ b/application/city/classes/filter/verifier/class_CityNameVerifierFilter.php @@ -2,6 +2,9 @@ // Own namespace namespace Org\Mxchange\City\Filter\Verifier; +// Import application-specific stuff +use Org\Mxchange\City\Database\Frontend\Information\CityInformationDatabaseWrapper; + // Import framework stuff use Org\Mxchange\CoreFramework\Filter\BaseFilter; use Org\Mxchange\CoreFramework\Filter\Filterable; diff --git a/application/city/classes/login/class_CityGuestLogin.php b/application/city/classes/login/class_CityGuestLogin.php index 3ec12fc..fe6f90b 100644 --- a/application/city/classes/login/class_CityGuestLogin.php +++ b/application/city/classes/login/class_CityGuestLogin.php @@ -5,6 +5,8 @@ namespace Org\Mxchange\City\Login\Guest; // Import framework stuff use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; +use Org\Mxchange\CoreFramework\Registry\Registerable; +use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -126,12 +128,12 @@ class CityGuestLogin extends BaseFrameworkSystem implements LoginableUser, Regis */ public function encryptPassword ($requestKey) { // Check if password is found in request - if ($this->getRequestInstance()->isRequestElementSet($requestKey)) { + if (FrameworkBootstrap::getRequestInstance()->isRequestElementSet($requestKey)) { // So encrypt the password and store it for later usage in // the request: // Get the plain password - $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); + $plainPassword = FrameworkBootstrap::getRequestInstance()->getRequestElement($requestKey); // Get user instance $userInstance = Registry::getRegistry()->getInstance('user'); @@ -140,7 +142,7 @@ class CityGuestLogin extends BaseFrameworkSystem implements LoginableUser, Regis $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash()); // Store the hash back in request - $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); + FrameworkBootstrap::getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); } // END - if } } diff --git a/application/city/classes/login/class_CityUserLogin.php b/application/city/classes/login/class_CityUserLogin.php index 7ab7f2d..7a68588 100644 --- a/application/city/classes/login/class_CityUserLogin.php +++ b/application/city/classes/login/class_CityUserLogin.php @@ -3,8 +3,10 @@ namespace Org\Mxchange\City\Login\User; // Import framework stuff +use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; +use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -135,12 +137,12 @@ class CityUserLogin extends BaseFrameworkSystem implements LoginableUser, Regist */ public function encryptPassword ($requestKey) { // Check if password is found in request - if ($this->getRequestInstance()->isRequestElementSet($requestKey)) { + if (FrameworkBootstrap::getRequestInstance()->isRequestElementSet($requestKey)) { // So encrypt the password and store it for later usage in // the request: // Get the plain password - $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); + $plainPassword = FrameworkBootstrap::getRequestInstance()->getRequestElement($requestKey); // Get user instance $userInstance = Registry::getRegistry()->getInstance('user'); @@ -149,7 +151,7 @@ class CityUserLogin extends BaseFrameworkSystem implements LoginableUser, Regist $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash()); // Store the hash back in request - $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); + FrameworkBootstrap::getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); } // END - if } } diff --git a/application/city/classes/login/helper/class_CityLoginHelper.php b/application/city/classes/login/helper/class_CityLoginHelper.php index 0a8b33c..632280a 100644 --- a/application/city/classes/login/helper/class_CityLoginHelper.php +++ b/application/city/classes/login/helper/class_CityLoginHelper.php @@ -3,6 +3,7 @@ namespace Org\Mxchange\City\Helper\Login; // Import framework stuff +use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; @@ -108,10 +109,10 @@ class CityLoginHelper extends BaseLoginHelper implements HelpableLogin { $loginInstance = ObjectFactory::createObjectByName($this->authMethod, array($responseInstance)); // Set user cookie - $loginInstance->setUserAuth($this->getRequestInstance()->getRequestElement('username')); + $loginInstance->setUserAuth(FrameworkBootstrap::getRequestInstance()->getRequestElement('username')); // Set password cookie - $loginInstance->setPasswordAuth($this->getRequestInstance()->getRequestElement('pass_hash')); + $loginInstance->setPasswordAuth(FrameworkBootstrap::getRequestInstance()->getRequestElement('pass_hash')); // Remember this login instance for later usage Registry::getRegistry()->addInstance('login', $loginInstance); diff --git a/application/city/classes/manager/city/class_CityManager.php b/application/city/classes/manager/city/class_CityManager.php index eb045a8..208a356 100644 --- a/application/city/classes/manager/city/class_CityManager.php +++ b/application/city/classes/manager/city/class_CityManager.php @@ -2,7 +2,12 @@ // Own namespace namespace Org\Mxchange\City\Manager\City; +// Import application-specific stuff +use Org\Mxchange\City\Database\Frontend\Information\CityInformationDatabaseWrapper; + // Import framework stuff +use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; +use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -92,11 +97,11 @@ class CityManager extends BaseManager implements ManageableCity { */ public function foundFirstCity () { // Check on request instance and 'city_name' element - assert($this->getRequestInstance() instanceof Requestable); - assert($this->getRequestInstance()->isRequestElementSet(CityInformationDatabaseWrapper::DB_COLUMN_CITY_NAME)); + assert(FrameworkBootstrap::getRequestInstance() instanceof Requestable); + assert(FrameworkBootstrap::getRequestInstance()->isRequestElementSet(CityInformationDatabaseWrapper::DB_COLUMN_CITY_NAME)); // Get city name - $cityName = $this->getRequestInstance()->getRequestElement(CityInformationDatabaseWrapper::DB_COLUMN_CITY_NAME); + $cityName = FrameworkBootstrap::getRequestInstance()->getRequestElement(CityInformationDatabaseWrapper::DB_COLUMN_CITY_NAME); // Some pre-checks assert(!$this->isCityAlreadyFounded()); @@ -116,10 +121,10 @@ class CityManager extends BaseManager implements ManageableCity { $regionData = $regionResultInstance->current(); // Add region id from it - $this->getRequestInstance()->setRequestElement(CityInformationDatabaseWrapper::DB_COLUMN_CITY_REGION_ID, $regionData[RegionInformationDatabaseWrapper::DB_COLUMN_REGION_ID]); + FrameworkBootstrap::getRequestInstance()->setRequestElement(CityInformationDatabaseWrapper::DB_COLUMN_CITY_REGION_ID, $regionData[RegionInformationDatabaseWrapper::DB_COLUMN_REGION_ID]); // Then create the first city - $this->getWrapperInstance()->createCityByRequest($this->getRequestInstance()); + $this->getWrapperInstance()->createCityByRequest(FrameworkBootstrap::getRequestInstance()); } /** diff --git a/application/city/classes/manager/city_entities/districts/class_CityDistrictsManager.php b/application/city/classes/manager/city_entities/districts/class_CityDistrictsManager.php index 63147d6..d308d42 100644 --- a/application/city/classes/manager/city_entities/districts/class_CityDistrictsManager.php +++ b/application/city/classes/manager/city_entities/districts/class_CityDistrictsManager.php @@ -3,7 +3,9 @@ namespace Org\Mxchange\City\Manager\District; // Import framework stuff +use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory; use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; +use Org\Mxchange\CoreFramework\Registry\Registerable; /** * A city districts manager diff --git a/application/city/classes/manager/city_entities/lots/class_CityLotsManager.php b/application/city/classes/manager/city_entities/lots/class_CityLotsManager.php index 3650cc2..55cbbcb 100644 --- a/application/city/classes/manager/city_entities/lots/class_CityLotsManager.php +++ b/application/city/classes/manager/city_entities/lots/class_CityLotsManager.php @@ -3,7 +3,9 @@ namespace Org\Mxchange\City\Manager\Lots; // Import framework stuff +use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory; use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; +use Org\Mxchange\CoreFramework\Registry\Registerable; /** * A city lots manager diff --git a/application/city/classes/manager/city_entities/sections/class_CitySectionsManager.php b/application/city/classes/manager/city_entities/sections/class_CitySectionsManager.php index 903d837..a04b8a3 100644 --- a/application/city/classes/manager/city_entities/sections/class_CitySectionsManager.php +++ b/application/city/classes/manager/city_entities/sections/class_CitySectionsManager.php @@ -3,7 +3,9 @@ namespace Org\Mxchange\City\Manager\Sections; // Import framework stuff +use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory; use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; +use Org\Mxchange\CoreFramework\Registry\Registerable; /** * A city sections manager diff --git a/application/city/classes/manager/class_ b/application/city/classes/manager/class_ index 880f586..a8cb292 100644 --- a/application/city/classes/manager/class_ +++ b/application/city/classes/manager/class_ @@ -4,6 +4,7 @@ namespace Org\Mxchange\City\Manager\; // Import framework stuff use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; +use Org\Mxchange\CoreFramework\Registry\Registerable; /** * A ??? manager diff --git a/application/city/classes/manager/class_BaseManager.php b/application/city/classes/manager/class_BaseManager.php index 7ceaa13..4fc07fa 100644 --- a/application/city/classes/manager/class_BaseManager.php +++ b/application/city/classes/manager/class_BaseManager.php @@ -2,9 +2,12 @@ // Own namespace namespace Org\Mxchange\City\Manager; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Generic\BaseCitySystem; +// Import framework stuff +use Org\Mxchange\CoreFramework\Registry\Registerable; + /** * A general Manager class * @@ -27,7 +30,7 @@ use Org\Mxchange\City\Generic\BaseCitySystem; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseManager extends BaseCitySystem implements Manageable, Registerable { +abstract class BaseManager extends BaseCitySystem implements Manageable, Registerable { /** * Protected constructor * diff --git a/application/city/classes/manager/game/class_GameManager.php b/application/city/classes/manager/game/class_GameManager.php index 6fa4849..6427001 100644 --- a/application/city/classes/manager/game/class_GameManager.php +++ b/application/city/classes/manager/game/class_GameManager.php @@ -1,4 +1,10 @@ getRequestInstance()->isRequestElementSet($requestKey)) { + if (FrameworkBootstrap::getRequestInstance()->isRequestElementSet($requestKey)) { // So encrypt the password and store it for later usage in // the request: // 1.: Get the plain password - $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); + $plainPassword = FrameworkBootstrap::getRequestInstance()->getRequestElement($requestKey); // 2. Get a crypto helper and hash the password $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword); // 3. Store the hash back in request - $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); + FrameworkBootstrap::getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); } } @@ -157,7 +159,7 @@ class CityRegistration extends BaseRegistration implements UserRegister { $actionInstance = ObjectFactory::createObjectByConfiguredName('post_registration_class'); // Execute the action - $actionInstance->execute($this->getRequestInstance(), $this->getResponseInstance()); + $actionInstance->execute(FrameworkBootstrap::getRequestInstance(), $this->getResponseInstance()); } /** @@ -182,20 +184,20 @@ class CityRegistration extends BaseRegistration implements UserRegister { // Do we have an alias? if (is_string($alias)) { // Yes, so use it - $criteriaInstance->addCriteria($alias, $this->getRequestInstance()->getRequestElement($element)); + $criteriaInstance->addCriteria($alias, FrameworkBootstrap::getRequestInstance()->getRequestElement($element)); // Debug message - //* DEBUG: */ $this->debugOutput('ALIAS: alias='.$alias.',element='.$element.'='.$this->getRequestInstance()->getRequestElement($element)); + //* DEBUG: */ $this->debugOutput('ALIAS: alias='.$alias.',element='.$element.'='.FrameworkBootstrap::getRequestInstance()->getRequestElement($element)); } else { // No, default entry - $criteriaInstance->addCriteria($element, $this->getRequestInstance()->getRequestElement($element)); + $criteriaInstance->addCriteria($element, FrameworkBootstrap::getRequestInstance()->getRequestElement($element)); // Debug message - //* DEBUG: */ $this->debugOutput('DEFAULT: element='.$element.'='.$this->getRequestInstance()->getRequestElement($element)); + //* DEBUG: */ $this->debugOutput('DEFAULT: element='.$element.'='.FrameworkBootstrap::getRequestInstance()->getRequestElement($element)); } // Is this a guest account? - if ((($element == 'username') || ($alias == 'username')) && ($this->getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->getConfigEntry('guest_login_user'))) { + if ((($element == 'username') || ($alias == 'username')) && (FrameworkBootstrap::getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->getConfigEntry('guest_login_user'))) { // Yes, then set the config entry to guest status $configEntry = 'user_status_guest'; } // END - if diff --git a/application/city/classes/states/city/active/class_CityActiveState.php b/application/city/classes/states/city/active/class_CityActiveState.php index 56a7821..22ac35e 100644 --- a/application/city/classes/states/city/active/class_CityActiveState.php +++ b/application/city/classes/states/city/active/class_CityActiveState.php @@ -2,8 +2,12 @@ // Own namespace namespace Org\Mxchange\City\State\Active; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\Factory\CityDaemonFactory; +use Org\Mxchange\City\State\BaseCityState; + +// Import framework stuff +use Org\Mxchange\CoreFramework\State\Stateable; /** * A active city state class diff --git a/application/city/classes/states/city/class_ b/application/city/classes/states/city/class_ index a81ff34..333ef1e 100644 --- a/application/city/classes/states/city/class_ +++ b/application/city/classes/states/city/class_ @@ -1,4 +1,13 @@ . */ -class BaseCityState extends BaseState { +abstract class BaseCityState extends BaseState { /** * Protected constructor * diff --git a/application/city/classes/states/city/init/class_CityInitState.php b/application/city/classes/states/city/init/class_CityInitState.php index 32ec04b..fe74f65 100644 --- a/application/city/classes/states/city/init/class_CityInitState.php +++ b/application/city/classes/states/city/init/class_CityInitState.php @@ -1,4 +1,15 @@ . */ -class BaseCityTask extends BaseTask { +abstract class BaseCityTask extends BaseTask { /** * An instance of a city */ diff --git a/application/city/classes/tasks/daemon/building/class_CityDaemonBuildingGrowthTask.php b/application/city/classes/tasks/daemon/building/class_CityDaemonBuildingGrowthTask.php index 084dbc5..0a0a817 100644 --- a/application/city/classes/tasks/daemon/building/class_CityDaemonBuildingGrowthTask.php +++ b/application/city/classes/tasks/daemon/building/class_CityDaemonBuildingGrowthTask.php @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Task\Growth\Building; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\Factory\CityDaemonFactory; /** diff --git a/application/city/classes/tasks/daemon/household/class_CityDaemonHouseholdGrowthTask.php b/application/city/classes/tasks/daemon/household/class_CityDaemonHouseholdGrowthTask.php index 2b25dd2..646d0ce 100644 --- a/application/city/classes/tasks/daemon/household/class_CityDaemonHouseholdGrowthTask.php +++ b/application/city/classes/tasks/daemon/household/class_CityDaemonHouseholdGrowthTask.php @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Task\Growth\Household; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\Factory\CityDaemonFactory; /** diff --git a/application/city/classes/tasks/daemon/map_expander/class_CityDaemonMapExpanderTask.php b/application/city/classes/tasks/daemon/map_expander/class_CityDaemonMapExpanderTask.php index d5b29a3..13c6666 100644 --- a/application/city/classes/tasks/daemon/map_expander/class_CityDaemonMapExpanderTask.php +++ b/application/city/classes/tasks/daemon/map_expander/class_CityDaemonMapExpanderTask.php @@ -2,7 +2,7 @@ // Own namespace namespace Org\Mxchange\City\Daemon\Task\Expander\Map; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\Factory\CityDaemonFactory; /** diff --git a/application/city/config.php b/application/city/config.php index ff7bb46..30e8470 100644 --- a/application/city/config.php +++ b/application/city/config.php @@ -44,7 +44,7 @@ $cfg->setConfigEntry('news_process_filter', 'Org\Mxchange\CoreFramework\Filter\N $cfg->setConfigEntry('news_reader_class', 'Org\Mxchange\CoreFramework\Reader\News\Console\ConsoleNewsReader'); // CFG: CITY-INFO-DB-WRAPPER-CLASS -$cfg->setConfigEntry('city_info_db_wrapper_class', 'CityInformationDatabaseWrapper'); +$cfg->setConfigEntry('city_info_db_wrapper_class', 'Org\Mxchange\City\Database\Frontend\Information\CityInformationDatabaseWrapper'); // CFG: REGION-INFO-DB-WRAPPER-CLASS $cfg->setConfigEntry('region_info_db_wrapper_class', 'RegionInformationDatabaseWrapper'); @@ -65,13 +65,13 @@ $cfg->setConfigEntry('city_lots_db_wrapper_class', 'CityLotsDatabaseWrapper'); $cfg->setConfigEntry('city_districts_db_wrapper_class', 'CityDistrictsDatabaseWrapper'); // CFG: CITY-INIT-STATE-CLASS -$cfg->setConfigEntry('city_init_state_class', 'CityInitState'); +$cfg->setConfigEntry('city_init_state_class', 'Org\Mxchange\City\State\Init\CityInitState'); // CFG: CITY-VIRGIN-STATE-CLASS -$cfg->setConfigEntry('city_virgin_state_class', 'CityVirginState'); +$cfg->setConfigEntry('city_virgin_state_class', 'Org\Mxchange\City\State\Virgin\CityVirginState'); // CFG: CITY-ACTIVE-STATE-CLASS -$cfg->setConfigEntry('city_active_state_class', 'CityActiveState'); +$cfg->setConfigEntry('city_active_state_class', 'Org\Mxchange\City\State\Active\CityActiveState'); /****************************************************************************** * HTML client * diff --git a/application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php b/application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php index 74d85cc..2de42b2 100644 --- a/application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php +++ b/application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php @@ -2,11 +2,12 @@ // Own namespace namespace Org\Mxchange\City\Database\Frontend\Information; -// Import own stuff +// Import application-specific stuff use Org\Mxchange\City\Daemon\BaseCityDaemon; use Org\Mxchange\City\Helper\CityHelper; // Import framework stuff +use Org\Mxchange\CoreFramework\Database\Frontend\DatabaseWrapper; use Org\Mxchange\CoreFramework\Request\Requestable; /** diff --git a/application/city/interfaces/database/frontend/city_entities/districts/class_CityDistrictsWrapper.php b/application/city/interfaces/database/frontend/city_entities/districts/class_CityDistrictsWrapper.php index 9852f2f..510bab2 100644 --- a/application/city/interfaces/database/frontend/city_entities/districts/class_CityDistrictsWrapper.php +++ b/application/city/interfaces/database/frontend/city_entities/districts/class_CityDistrictsWrapper.php @@ -1,4 +1,10 @@ getRequestInstance(). + * get it from calling FrameworkBootstrap::getRequestInstance(). * * @return void */ diff --git a/core b/core index edbaec7..2882b57 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit edbaec7aa8e1019d10b7a3351e1629fed93740f4 +Subproject commit 2882b57ca6f372b822f96034ff2fe6aafd7daeb8