- '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 <roland@mxchange.org>
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;
/**
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;
$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();
*/
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);
// 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;
/**
/**
* 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;
}
*/
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();
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;
*/
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 ------------------------
$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. ---');
// 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');
// 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
// 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');
// 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');
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;
// 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');
// 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;
*/
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) {
$actionInstance = NULL;
// Get registry
- $registryInstance = Registry::getRegistry();
+ $registryInstance = GenericRegistry::getRegistry();
// Get our application instance from the registry
$applicationInstance = $registryInstance->getInstance('application');
$actionInstance->addExtraFilters($controllerInstance, $requestInstance);
// Remember this action in registry
- Registry::getRegistry()->addInstance('action', $actionInstance);
+ GenericRegistry::getRegistry()->addInstance('action', $actionInstance);
}
}
*/
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();
// 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();
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;
*/
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();
// 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;
/**
*/
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');
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));
// 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
*/
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');
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));
// 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
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));
// 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;
$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');
$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);
// 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
$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
// 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;
*/
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();
// 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;
$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');
// 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;
$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) {
*/
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;
$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());
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;
$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) {
*/
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;
$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());
// 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;
/**
$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) {
// Set default login method from config
$helperInstance->setDefaultAuthMethod();
- // Set request instance
- $helperInstance->setRequestInstance($requestInstance);
-
// Return the prepared instance
return $helperInstance;
}
$loginInstance->setPasswordAuth(FrameworkBootstrap::getRequestInstance()->getRequestElement('pass_hash'));
// Remember this login instance for later usage
- Registry::getRegistry()->addInstance('login', $loginInstance);
+ GenericRegistry::getRegistry()->addInstance('login', $loginInstance);
}
}
-Subproject commit bb121094b0c87c1ed028dfb5f86565b782742e6d
+Subproject commit 5135152658d9678af5871e0cd9ad86c259ad1e5c