From: Roland Häder Date: Sat, 3 Mar 2018 23:40:40 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b77ed87b8a501aa7cd4a7daba82d69ffaf712a2a;p=city.git Continued: - 'app' is only parameter, 'application' is the application instance in registry - changed Registry to GenericRegistry - setting/getting request instance is now fully covered by FrameworkBootstrap - updated core to latest commit Signed-off-by: Roland Häder --- diff --git a/application/city/class_ApplicationHelper.php b/application/city/class_ApplicationHelper.php index 688f599..9ced8a1 100644 --- a/application/city/class_ApplicationHelper.php +++ b/application/city/class_ApplicationHelper.php @@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Loader\ClassLoader; use Org\Mxchange\CoreFramework\Manager\ManageableApplication; use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; use Org\Mxchange\CoreFramework\Registry\Registerable; -use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Template\CompileableTemplate; /** diff --git a/application/city/classes/city_daemon/class_BaseCityDaemon.php b/application/city/classes/city_daemon/class_BaseCityDaemon.php index 3543c39..667eaac 100644 --- a/application/city/classes/city_daemon/class_BaseCityDaemon.php +++ b/application/city/classes/city_daemon/class_BaseCityDaemon.php @@ -15,7 +15,7 @@ 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\Registry\GenericRegistry;; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -76,7 +76,7 @@ abstract class BaseCityDaemon extends BaseCitySystem implements Updateable, Adda $this->setCryptoInstance($cryptoInstance); // Add own instance to registry - Registry::getRegistry()->addInstance('city', $this); + GenericRegistry::getRegistry()->addInstance('city', $this); // Init state which sets the state to 'init' $this->initState(); @@ -179,7 +179,7 @@ abstract class BaseCityDaemon extends BaseCitySystem implements Updateable, Adda */ public function activateCityDaemon (Requestable $requestInstance, Responseable $responseInstance) { // Get the controller here - $controllerInstance = Registry::getRegistry()->getInstance('controller'); + $controllerInstance = GenericRegistry::getRegistry()->getInstance('controller'); // Run all filters for the City activation $controllerInstance->executeActivationFilters($requestInstance, $responseInstance); diff --git a/application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php b/application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php index a21b9d5..a474764 100644 --- a/application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php +++ b/application/city/classes/city_daemon/default/class_SimulationDefaultCityDaemon.php @@ -9,8 +9,8 @@ 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\GenericRegistry; use Org\Mxchange\CoreFramework\Registry\Registerable; -use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; /** @@ -49,16 +49,12 @@ class SimulationDefaultCityDaemon extends BaseCityDaemon implements CityHelper, /** * Creates an instance of this hub-node class * - * @param $requestInstance An instance of a Requestable class * @return $nodeInstance An instance of this hub-node class */ - public static final function createSimulationDefaultCityDaemon (Requestable $requestInstance) { + public static final function createSimulationDefaultCityDaemon () { // Get a new instance $nodeInstance = new SimulationDefaultCityDaemon(); - // Set the request instance - $nodeInstance->setRequestInstance($requestInstance); - // Return the instance return $nodeInstance; } @@ -81,7 +77,7 @@ class SimulationDefaultCityDaemon extends BaseCityDaemon implements CityHelper, */ public function addExtraCityFilters () { // Get the application instance from registry - $applicationInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); // Get the controller from the application $controllerInstance = $applicationInstance->getControllerInstance(); diff --git a/application/city/classes/commands/console/class_CityConsoleDaemonCommand.php b/application/city/classes/commands/console/class_CityConsoleDaemonCommand.php index f2e006b..62d16d6 100644 --- a/application/city/classes/commands/console/class_CityConsoleDaemonCommand.php +++ b/application/city/classes/commands/console/class_CityConsoleDaemonCommand.php @@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Command\BaseCommand; use Org\Mxchange\CoreFramework\Command\Commandable; use Org\Mxchange\CoreFramework\Controller\Controller; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; -use Org\Mxchange\CoreFramework\Registry\Registry; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -75,7 +75,7 @@ class CityConsoleDaemonCommand extends BaseCommand implements Commandable { */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get a registry and the application instance from it - $applicationInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); /* * ----------------------- Bootstrapping phase ------------------------ @@ -101,7 +101,7 @@ class CityConsoleDaemonCommand extends BaseCommand implements Commandable { $cityInstance->activateCityDaemon($requestInstance, $responseInstance); // Get task handler instance - $handlerInstance = Registry::getRegistry()->getInstance('task_handler'); + $handlerInstance = GenericRegistry::getRegistry()->getInstance('task_handler'); // Debug message self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Entering main loop. ---'); diff --git a/application/city/classes/commands/html/class_CityHtmlCityGuestLoginCommand.php b/application/city/classes/commands/html/class_CityHtmlCityGuestLoginCommand.php index bb444a4..5f47cfd 100644 --- a/application/city/classes/commands/html/class_CityHtmlCityGuestLoginCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlCityGuestLoginCommand.php @@ -72,9 +72,6 @@ class CityHtmlCityGuestLoginCommand extends BaseCommand implements Commandable { // First get a GuestLogin instance $loginInstance = ObjectFactory::createObjectByConfiguredName('guest_login_class'); - // First set request and response instance - $loginInstance->setRequestInstance($requestInstance); - // Encrypt the password $loginInstance->encryptPassword('passwd'); diff --git a/application/city/classes/commands/html/class_CityHtmlCityMapCommand.php b/application/city/classes/commands/html/class_CityHtmlCityMapCommand.php index eccba63..3e5c34b 100644 --- a/application/city/classes/commands/html/class_CityHtmlCityMapCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlCityMapCommand.php @@ -79,10 +79,6 @@ class CityHtmlCityMapCommand extends BaseCommand implements Commandable { // Make sure the instance is valid assert($managerInstance instanceof ManageableCity); - // First set request and response instance - $managerInstance->setRequestInstance($requestInstance); - $managerInstance->setResponseInstance($responseInstance); - // Is there already a city the user has founded? if ($managerInstance->isCityAlreadyFounded()) { // Found 2nd,3rd,... city diff --git a/application/city/classes/commands/html/class_CityHtmlCityRegisterCommand.php b/application/city/classes/commands/html/class_CityHtmlCityRegisterCommand.php index 9b609b7..b643c0e 100644 --- a/application/city/classes/commands/html/class_CityHtmlCityRegisterCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlCityRegisterCommand.php @@ -72,10 +72,6 @@ class CityHtmlCityRegisterCommand extends BaseCommand implements Commandable { // First get a UserRegistration instance $registerInstance = ObjectFactory::createObjectByConfiguredName('user_registration_class'); - // First set request and response instance - $registerInstance->setRequestInstance($requestInstance); - $registerInstance->setResponseInstance($responseInstance); - // Encrypt the password $registerInstance->encryptPassword('pass1'); diff --git a/application/city/classes/commands/html/class_CityHtmlCityUserLoginCommand.php b/application/city/classes/commands/html/class_CityHtmlCityUserLoginCommand.php index fbc91e2..0a35eb5 100644 --- a/application/city/classes/commands/html/class_CityHtmlCityUserLoginCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlCityUserLoginCommand.php @@ -72,9 +72,6 @@ class CityHtmlCityUserLoginCommand extends BaseCommand implements Commandable { // First get a UserLogin instance $loginInstance = ObjectFactory::createObjectByConfiguredName('user_login_class'); - // First set request and response instance - $loginInstance->setRequestInstance($requestInstance); - // Encrypt the password $loginInstance->encryptPassword('pass'); diff --git a/application/city/classes/commands/html/class_CityHtmlConfirmCommand.php b/application/city/classes/commands/html/class_CityHtmlConfirmCommand.php index 1dc4b43..9c46a14 100644 --- a/application/city/classes/commands/html/class_CityHtmlConfirmCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlConfirmCommand.php @@ -6,7 +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\Registry; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -112,7 +112,7 @@ class CityHtmlConfirmCommand extends BaseCommand implements Commandable { // Get user instance try { - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); } catch (NullPointerException $e) { // Not found user, e.g. when the user is somehow invalid $responseInstance->redirectToConfiguredUrl('html_cmd_user_is_null'); diff --git a/application/city/classes/commands/html/class_CityHtmlLoginAreaCommand.php b/application/city/classes/commands/html/class_CityHtmlLoginAreaCommand.php index 024f86d..0cb727b 100644 --- a/application/city/classes/commands/html/class_CityHtmlLoginAreaCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlLoginAreaCommand.php @@ -4,7 +4,7 @@ namespace Org\Mxchange\City\Command; // Import framework stuff use Org\Mxchange\CoreFramework\Controller\Controller; -use Org\Mxchange\CoreFramework\Registry\Registry; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -85,7 +85,7 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable { */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get the action instance from registry - $actionInstance = Registry::getRegistry()->getInstance('action'); + $actionInstance = GenericRegistry::getRegistry()->getInstance('action'); // Do we have an action here? if ($actionInstance instanceof PerformableAction) { @@ -175,7 +175,7 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable { $actionInstance = NULL; // Get registry - $registryInstance = Registry::getRegistry(); + $registryInstance = GenericRegistry::getRegistry(); // Get our application instance from the registry $applicationInstance = $registryInstance->getInstance('application'); @@ -205,6 +205,6 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable { $actionInstance->addExtraFilters($controllerInstance, $requestInstance); // Remember this action in registry - Registry::getRegistry()->addInstance('action', $actionInstance); + GenericRegistry::getRegistry()->addInstance('action', $actionInstance); } } diff --git a/application/city/classes/commands/html/class_CityHtmlLoginCommand.php b/application/city/classes/commands/html/class_CityHtmlLoginCommand.php index a347217..46cd32a 100644 --- a/application/city/classes/commands/html/class_CityHtmlLoginCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlLoginCommand.php @@ -70,7 +70,7 @@ class CityHtmlLoginCommand extends BaseCommand implements Commandable, Registera */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Set request instance as extra instance - Registry::getRegistry()->addInstance('extra', $this); + GenericRegistry::getRegistry()->addInstance('extra', $this); // Get the application instance $applicationInstance = $this->getResolverInstance()->getApplicationInstance(); diff --git a/application/city/classes/commands/html/class_CityHtmlLogoutCommand.php b/application/city/classes/commands/html/class_CityHtmlLogoutCommand.php index 8cac273..d632497 100644 --- a/application/city/classes/commands/html/class_CityHtmlLogoutCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlLogoutCommand.php @@ -71,9 +71,6 @@ class CityHtmlLogoutCommand extends BaseCommand implements Commandable { // Get an auth instance for checking and updating the auth cookies $authInstance = ObjectFactory::createObjectByConfiguredName('auth_method_class', array($responseInstance)); - // Set request instance - $authInstance->setRequestInstance($requestInstance); - // Destroy the auth data $authInstance->destroyAuthData(); diff --git a/application/city/classes/commands/html/class_CityHtmlResendLinkCommand.php b/application/city/classes/commands/html/class_CityHtmlResendLinkCommand.php index 75d6adf..b67be67 100644 --- a/application/city/classes/commands/html/class_CityHtmlResendLinkCommand.php +++ b/application/city/classes/commands/html/class_CityHtmlResendLinkCommand.php @@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Command\BaseCommand; use Org\Mxchange\CoreFramework\Command\Commandable; use Org\Mxchange\CoreFramework\Controller\Controller; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; -use Org\Mxchange\CoreFramework\Registry\Registry; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -71,7 +71,7 @@ class CityHtmlResendLinkCommand extends BaseCommand implements Commandable { */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get user instance from registry - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Get an application instance $applicationInstance = $this->getResolverInstance()->getApplicationInstance(); diff --git a/application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php b/application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php index 071b150..7963d17 100644 --- a/application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php +++ b/application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php @@ -11,8 +11,8 @@ use Org\Mxchange\City\Manager\City\ManageableCity; // Import framework stuff use Org\Mxchange\CoreFramework\Database\Frontend\BaseDatabaseWrapper; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Registry\Registerable; -use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; /** @@ -146,7 +146,7 @@ class CityInformationDatabaseWrapper extends BaseDatabaseWrapper implements City */ public function ifUserHasFoundedCity () { // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Now get a search criteria instance $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); @@ -224,7 +224,7 @@ class CityInformationDatabaseWrapper extends BaseDatabaseWrapper implements City assert(!$this->ifCityExists($cityName)); // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Get a dataset instance $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_CITY_INFORMATION)); diff --git a/application/city/classes/database/frontend/region/class_RegionInformationDatabaseWrapper.php b/application/city/classes/database/frontend/region/class_RegionInformationDatabaseWrapper.php index 720f818..3938f93 100644 --- a/application/city/classes/database/frontend/region/class_RegionInformationDatabaseWrapper.php +++ b/application/city/classes/database/frontend/region/class_RegionInformationDatabaseWrapper.php @@ -8,8 +8,8 @@ use Org\Mxchange\City\Factory\Manager\ManagerFactory; // Import framework stuff use Org\Mxchange\CoreFramework\Database\Frontend\BaseDatabaseWrapper; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Registry\Registerable; -use Org\Mxchange\CoreFramework\Registry\Registry; /** * A database wrapper for region informations @@ -90,7 +90,7 @@ class RegionInformationDatabaseWrapper extends BaseDatabaseWrapper implements Re */ public function ifUserHasCreatedRegion () { // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Now get a search criteria instance $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); @@ -162,7 +162,7 @@ class RegionInformationDatabaseWrapper extends BaseDatabaseWrapper implements Re assert(!$this->ifRegionExists($regionName)); // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Get a dataset instance $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_REGION_INFORMATION)); diff --git a/application/city/classes/database/frontend/region_map/class_RegionMapDatabaseWrapper.php b/application/city/classes/database/frontend/region_map/class_RegionMapDatabaseWrapper.php index 2c15ad5..9c2a2c2 100644 --- a/application/city/classes/database/frontend/region_map/class_RegionMapDatabaseWrapper.php +++ b/application/city/classes/database/frontend/region_map/class_RegionMapDatabaseWrapper.php @@ -5,8 +5,8 @@ namespace Org\Mxchange\City\Database\Frontend\Region; // Import framework stuff use Org\Mxchange\CoreFramework\Database\Frontend\BaseDatabaseWrapper; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Registry\Registerable; -use Org\Mxchange\CoreFramework\Registry\Registry; /** * A database wrapper for region maps @@ -89,7 +89,7 @@ class RegionMapDatabaseWrapper extends BaseDatabaseWrapper implements RegionMapW assert(!$this->ifRegionExists($regionName)); // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Get a dataset instance $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_REGION_MAP)); diff --git a/application/city/classes/factories/city_daemon/class_CityDaemonFactory.php b/application/city/classes/factories/city_daemon/class_CityDaemonFactory.php index 6165d10..c4ada48 100644 --- a/application/city/classes/factories/city_daemon/class_CityDaemonFactory.php +++ b/application/city/classes/factories/city_daemon/class_CityDaemonFactory.php @@ -4,7 +4,7 @@ namespace Org\Mxchange\City\Daemon\Factory; // Import framework stuff use Org\Mxchange\CoreFramework\Factory\ObjectFactory; -use Org\Mxchange\CoreFramework\Registry\Registry; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -54,9 +54,9 @@ class CityDaemonFactory extends ObjectFactory { $factoryInstance = new CityDaemonFactory(); // If there is no handler? - if (Registry::getRegistry()->instanceExists('city')) { + if (GenericRegistry::getRegistry()->instanceExists('city')) { // Get handler from registry - $cityInstance = Registry::getRegistry()->getInstance('city'); + $cityInstance = GenericRegistry::getRegistry()->getInstance('city'); } elseif (($requestInstance instanceof Requestable) && ($responseInstance instanceof Responseable)) { // The default city-mode is from our configuration $cityMode = $factoryInstance->getConfigInstance()->getConfigEntry('city_default_mode'); @@ -77,7 +77,7 @@ class CityDaemonFactory extends ObjectFactory { $cityInstance = ObjectFactory::createObjectByName($className, array($requestInstance)); // Get a registry - $applicationInstance = Registry::getRegistry()->getInstance('app'); + $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); // Set the app instance $cityInstance->setApplicationInstance($applicationInstance); diff --git a/application/city/classes/factories/manager/class_ManagerFactory.php b/application/city/classes/factories/manager/class_ManagerFactory.php index 7c2b5be..6dac023 100644 --- a/application/city/classes/factories/manager/class_ManagerFactory.php +++ b/application/city/classes/factories/manager/class_ManagerFactory.php @@ -4,7 +4,7 @@ namespace Org\Mxchange\City\Factory\Manager; // Import framework stuff use Org\Mxchange\CoreFramework\Factory\ObjectFactory; -use Org\Mxchange\CoreFramework\Registry\Registry; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; /** * A factory class for managers @@ -53,15 +53,15 @@ class ManagerFactory extends ObjectFactory { $key = $type . '_manager'; // If there is no handler? - if (Registry::getRegistry()->instanceExists($key)) { + if (GenericRegistry::getRegistry()->instanceExists($key)) { // Get handler from registry - $managerInstance = Registry::getRegistry()->getInstance($key); + $managerInstance = GenericRegistry::getRegistry()->getInstance($key); } else { // Get the proper manager instance $managerInstance = ObjectFactory::createObjectByConfiguredName($key . '_class'); // Add it to the registry - Registry::getRegistry()->addInstance($key, $managerInstance); + GenericRegistry::getRegistry()->addInstance($key, $managerInstance); } // Return the instance diff --git a/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php b/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php index 0edc4bc..dd7e376 100644 --- a/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php +++ b/application/city/classes/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php @@ -7,7 +7,7 @@ use Org\Mxchange\City\Filter\BaseCityFilter; // Import framework stuff use Org\Mxchange\CoreFramework\Filter\Filterable; -use Org\Mxchange\CoreFramework\Registry\Registry; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -68,7 +68,7 @@ class CityDaemonShutdownTaskHandlerFilter extends BaseCityFilter implements Filt */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get task handler instance - $handlerInstance = Registry::getRegistry()->getInstance('task_handler'); + $handlerInstance = GenericRegistry::getRegistry()->getInstance('task_handler'); // Shutdown the task manager and all its registered tasks $handlerInstance->doShutdown(); 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 c318db8..642e8ac 100644 --- a/application/city/classes/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php +++ b/application/city/classes/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php @@ -9,7 +9,7 @@ use Org\Mxchange\City\Filter\BaseCityFilter; // Import framework stuff use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Filter\Filterable; -use Org\Mxchange\CoreFramework\Registry\Registry; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -76,7 +76,7 @@ class CityDaemonTaskHandlerInitializerFilter extends BaseCityFilter implements F $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class'); // Put the task handler in registry - Registry::getRegistry()->addInstance('task_handler', $handlerInstance); + GenericRegistry::getRegistry()->addInstance('task_handler', $handlerInstance); // Prepare a city map expansion task $taskInstance = ObjectFactory::createObjectByConfiguredName('city_daemon_map_expander_task_class'); diff --git a/application/city/classes/login/class_CityGuestLogin.php b/application/city/classes/login/class_CityGuestLogin.php index fe6f90b..14fd428 100644 --- a/application/city/classes/login/class_CityGuestLogin.php +++ b/application/city/classes/login/class_CityGuestLogin.php @@ -5,8 +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\GenericRegistry; use Org\Mxchange\CoreFramework\Registry\Registerable; -use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -77,7 +77,7 @@ class CityGuestLogin extends BaseFrameworkSystem implements LoginableUser, Regis $userInstance = UserFactory::createUserByRequest($requestInstance); // Remember this new instance in registry - Registry::getRegistry()->addInstance('user', $userInstance); + GenericRegistry::getRegistry()->addInstance('user', $userInstance); // Is the password correct? if ($userInstance->ifPasswordHashMatches($requestInstance) === FALSE) { @@ -113,7 +113,7 @@ class CityGuestLogin extends BaseFrameworkSystem implements LoginableUser, Regis */ public function ifLoginWasSuccessfull () { // Is the registry key there? - $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable); + $loginDone = (GenericRegistry::getRegistry()->getInstance('login') instanceof Registerable); // Return the result return $loginDone; @@ -136,7 +136,7 @@ class CityGuestLogin extends BaseFrameworkSystem implements LoginableUser, Regis $plainPassword = FrameworkBootstrap::getRequestInstance()->getRequestElement($requestKey); // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Get a crypto helper and hash the password $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash()); diff --git a/application/city/classes/login/class_CityUserLogin.php b/application/city/classes/login/class_CityUserLogin.php index 7a68588..ac9f9b1 100644 --- a/application/city/classes/login/class_CityUserLogin.php +++ b/application/city/classes/login/class_CityUserLogin.php @@ -6,8 +6,8 @@ namespace Org\Mxchange\City\Login\User; use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; +use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Registry\Registerable; -use Org\Mxchange\CoreFramework\Registry\Registry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Response\Responseable; @@ -81,7 +81,7 @@ class CityUserLogin extends BaseFrameworkSystem implements LoginableUser, Regist $userInstance = UserFactory::createUserByRequest($requestInstance); // Remember this new instance in registry - Registry::getRegistry()->addInstance('user', $userInstance); + GenericRegistry::getRegistry()->addInstance('user', $userInstance); // Is the password correct? if ($userInstance->ifPasswordHashMatches($requestInstance) === FALSE) { @@ -122,7 +122,7 @@ class CityUserLogin extends BaseFrameworkSystem implements LoginableUser, Regist */ public function ifLoginWasSuccessfull () { // Is the registry key there? - $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable); + $loginDone = (GenericRegistry::getRegistry()->getInstance('login') instanceof Registerable); // Return the result return $loginDone; @@ -145,7 +145,7 @@ class CityUserLogin extends BaseFrameworkSystem implements LoginableUser, Regist $plainPassword = FrameworkBootstrap::getRequestInstance()->getRequestElement($requestKey); // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Get a crypto helper and hash the password $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash()); diff --git a/application/city/classes/login/helper/class_CityLoginHelper.php b/application/city/classes/login/helper/class_CityLoginHelper.php index 632280a..b33105b 100644 --- a/application/city/classes/login/helper/class_CityLoginHelper.php +++ b/application/city/classes/login/helper/class_CityLoginHelper.php @@ -5,7 +5,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\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; /** @@ -70,7 +70,7 @@ class CityLoginHelper extends BaseLoginHelper implements HelpableLogin { $helperInstance = new CityLoginHelper(); // Get a user instance from registry - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Is this instance valid? if (!$userInstance instanceof ManageableAccount) { @@ -81,9 +81,6 @@ class CityLoginHelper extends BaseLoginHelper implements HelpableLogin { // Set default login method from config $helperInstance->setDefaultAuthMethod(); - // Set request instance - $helperInstance->setRequestInstance($requestInstance); - // Return the prepared instance return $helperInstance; } @@ -115,6 +112,6 @@ class CityLoginHelper extends BaseLoginHelper implements HelpableLogin { $loginInstance->setPasswordAuth(FrameworkBootstrap::getRequestInstance()->getRequestElement('pass_hash')); // Remember this login instance for later usage - Registry::getRegistry()->addInstance('login', $loginInstance); + GenericRegistry::getRegistry()->addInstance('login', $loginInstance); } } diff --git a/core b/core index bb12109..5135152 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit bb121094b0c87c1ed028dfb5f86565b782742e6d +Subproject commit 5135152658d9678af5871e0cd9ad86c259ad1e5c