use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
use Org\Mxchange\CoreFramework\Loader\ClassLoader;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Result\Database\CachedDatabaseResult;
use Org\Mxchange\CoreFramework\State\Stateable;
use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
* @return void
*/
public final function setWebOutputInstance (OutputStreamer $webInstance) {
- GenericRegistry::getRegistry()->addInstance('web_output', $webInstance);
+ ObjectRegistry::getRegistry()->addInstance('web_output', $webInstance);
}
/**
* @return $webOutputInstance - Instance to class WebOutput
*/
public final function getWebOutputInstance () {
- return GenericRegistry::getRegistry()->getInstance('web_output');
+ return ObjectRegistry::getRegistry()->getInstance('web_output');
}
/**
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\Traits\Resolver\ResolverTrait;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
use Org\Mxchange\CoreFramework\Response\Responseable;
// Get user instance
try {
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
} catch (NullPointerException $e) {
// Not found user, e.g. when the user is somehow invalid
$responseInstance->redirectToConfiguredUrl('html_cmd_user_is_null');
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-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;
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
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 = GenericRegistry::getRegistry()->getInstance('action');
+ $actionInstance = ObjectRegistry::getRegistry()->getInstance('action');
// Do we have an action here?
if ($actionInstance instanceof PerformableAction) {
$actionInstance->addExtraFilters($controllerInstance, $requestInstance);
// Remember this action in registry
- GenericRegistry::getRegistry()->addInstance('action', $actionInstance);
+ ObjectRegistry::getRegistry()->addInstance('action', $actionInstance);
}
}
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
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) {
// Set request instance as extra instance
- GenericRegistry::getRegistry()->addInstance('extra', $this);
+ ObjectRegistry::getRegistry()->addInstance('extra', $this);
// Get the application instance
$applicationInstance = ApplicationHelper::getSelfInstance();
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-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;
use Org\Mxchange\CoreFramework\Command\Commandable;
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-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;
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-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;
use Org\Mxchange\CoreFramework\Command\Commandable;
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
-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;
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
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) {
// Set request instance as extra instance
- GenericRegistry::getRegistry()->addInstance('extra', $this);
+ ObjectRegistry::getRegistry()->addInstance('extra', $this);
// Get the application instance
$applicationInstance = ApplicationHelper::getSelfInstance();
use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
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 = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
// Get an application instance
$applicationInstance = ApplicationHelper::getSelfInstance();
use Org\Mxchange\CoreFramework\Command\Commandable;
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-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;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
$this->initFilterChain(self::FILTER_CHAIN_POST_COMMAND);
// Add this controller to the registry
- GenericRegistry::getRegistry()->addInstance('controller', $this);
+ ObjectRegistry::getRegistry()->addInstance('controller', $this);
}
/**
$registryKey = strtolower($protocolInstance->getProtocolName()) . '_client';
// Is the key already in registry?
- if (GenericRegistry::getRegistry()->instanceExists($registryKey)) {
+ if (ObjectRegistry::getRegistry()->instanceExists($registryKey)) {
// Then use that instance
- $clientInstance = GenericRegistry::getRegistry()->getInstance($registryKey);
+ $clientInstance = ObjectRegistry::getRegistry()->getInstance($registryKey);
// Set socket resource
$clientInstance->setSocketResource($socketResource);
$clientInstance = ObjectFactory::createObjectByConfiguredName($registryKey, array($socketResource));
// Set it in registry for later re-use
- GenericRegistry::getRegistry()->addInstance($registryKey, $clientInstance);
+ ObjectRegistry::getRegistry()->addInstance($registryKey, $clientInstance);
}
// Return the prepared instance
// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
/**
* A factory class for socket registries
*/
public static final function createFrontendByConfiguredName (string $frontendName) {
// Get registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry();
// Do we have an instance in the registry?
if ($registryInstance->instanceExists($frontendName)) {
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
// Import SPL stuff
use \InvalidArgumentException;
if (empty($type)) {
// Throw IAE
throw new InvalidArgumentException('Parameter "type" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
- } elseif (GenericRegistry::getRegistry()->instanceExists($type . '_index')) {
+ } elseif (ObjectRegistry::getRegistry()->instanceExists($type . '_index')) {
// Get handler from registry
- $indexInstance = GenericRegistry::getRegistry()->getInstance($type . '_index');
+ $indexInstance = ObjectRegistry::getRegistry()->getInstance($type . '_index');
} else {
// Get the handler instance
$indexInstance = ObjectFactory::createObjectByConfiguredName($type . '_file_stack_index_class', [$fileInfoInstance]);
// Add it to the registry
- GenericRegistry::getRegistry()->addInstance($type . '_index', $indexInstance);
+ ObjectRegistry::getRegistry()->addInstance($type . '_index', $indexInstance);
}
// Return the instance
// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
/**
*/
public static final function createLoginObjectByRequest (Requestable $requestInstance) {
// Get registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry();
// Do we have an instance in the registry?
if ($registryInstance->instanceExists('login_helper')) {
// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
/**
* A factory class for socket registries
*/
public static final function createSocketRegistryInstance () {
// Get registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry();
// Do we have an instance in the registry?
if ($registryInstance->instanceExists('socket_registry')) {
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
// Import SPL stuff
use \InvalidArgumentException;
));
// If there is no handler?
- if (GenericRegistry::getRegistry()->instanceExists($stackName . '_stack')) {
+ if (ObjectRegistry::getRegistry()->instanceExists($stackName . '_stack')) {
// Get handler from registry
- $stackInstance = GenericRegistry::getRegistry()->getInstance($stackName . '_stack');
+ $stackInstance = ObjectRegistry::getRegistry()->getInstance($stackName . '_stack');
} else {
// Get the handler instance
$stackInstance = ObjectFactory::createObjectByConfiguredName($prefix . '_' . $stackName . '_stack_class', array($fileInfoInstance, $prefix . '_' . $stackName));
// Add it to the registry
- GenericRegistry::getRegistry()->addInstance($stackName . '_stack', $stackInstance);
+ ObjectRegistry::getRegistry()->addInstance($stackName . '_stack', $stackInstance);
}
// Return the instance
// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
/**
*/
public static final function createUserByRequest (Requestable $requestInstance) {
// Get registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry();
// Do we have an instance in the registry?
if ($registryInstance->instanceExists('user')) {
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
// Import SPL stuff
use \InvalidArgumentException;
}
// Do we have an instance in the registry?
- if (GenericRegistry::getRegistry()->instanceExists($configKey)) {
+ if (ObjectRegistry::getRegistry()->instanceExists($configKey)) {
// Then use this instance
- $templateInstance = GenericRegistry::getRegistry()->getInstance($configKey);
+ $templateInstance = ObjectRegistry::getRegistry()->getInstance($configKey);
} else {
// Get the XML template instance
$templateInstance = ObjectFactory::createObjectByConfiguredName($configKey);
$templateInstance->enableXmlCompacting();
// Set the instance in registry for further use
- GenericRegistry::getRegistry()->addInstance($configKey, $templateInstance);
+ ObjectRegistry::getRegistry()->addInstance($configKey, $templateInstance);
}
// Return the instance
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Loader\NoClassException;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\User\BaseUser;
}
// Now try the dynamic login
- $userInstance = call_user_func_array(array($className, $methodName), array($authLogin));
+ $userInstance = call_user_func_array([$className, $methodName], [$authLogin]);
// Is the password correct?
if ($userInstance->getPasswordHash() !== $authHash) {
}
// Remember auth and user instances in registry
- GenericRegistry::getRegistry()->addInstance('auth', $authInstance);
- GenericRegistry::getRegistry()->addInstance('user', $userInstance);
+ ObjectRegistry::getRegistry()->addInstance('auth', $authInstance);
+ ObjectRegistry::getRegistry()->addInstance('user', $userInstance);
}
}
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
}
// Now, get a user instance for comparison
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
// Get the email field
$userEmail = $userInstance->getField('email');
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
}
// Now, get a user instance for comparison
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
// Update the "password" field
DebugMiddleware::getSelfInstance()->partialStub('Unfinished part.');
use Org\Mxchange\CoreFramework\Factory\News\HtmlNewsFactory;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
$newsInstance = HtmlNewsFactory::createFactoryByRequest($requestInstance);
// Store the news instance in registry
- GenericRegistry::getRegistry()->addInstance('news', $newsInstance);
+ ObjectRegistry::getRegistry()->addInstance('news', $newsInstance);
}
}
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Loader\NoClassException;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
$discoveryInstance->discover($requestInstance);
// Remember this instance if all wents fine
- GenericRegistry::getRegistry()->addInstance('payments', $discoveryInstance);
+ ObjectRegistry::getRegistry()->addInstance('payments', $discoveryInstance);
} catch (NoConfigEntryException $e) {
// Something bad happend
$requestInstance->setIsRequestValid(FALSE);
use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get user instance from registry
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
// Get "confirmed" status from config
$confirmed = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_confirmed');
// Import framework stuff
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get user instance from registry
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
// Now update last activity
$userInstance->updateLastActivity($requestInstance);
// Update auth data as well
- $authInstance = GenericRegistry::getRegistry()->getInstance('auth');
+ $authInstance = ObjectRegistry::getRegistry()->getInstance('auth');
$authInstance->updateAuthData();
// Write all updates to the database
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
$userInstance = NULL;
// Get a registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry();
// Is the user already there?
if ($registryInstance->instanceExists('user')) {
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\User\UsernameMissingException;
$userInstance = NULL;
// Get a registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry();
// Is the user already there?
if ($registryInstance->instanceExists('user')) {
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\User\BaseUser;
}
// Get a user instance
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
// Get current hash
$currentHash = $userInstance->getField('pass_hash');
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
}
// Get a user instance from registry
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
// Get the confirm code from user for comparison
$userCode = $userInstance->getField(UserDatabaseFrontend::DB_COLUMN_CONFIRM_HASH);
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
$userInstance = NULL;
// Get a registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry();
// Is the user already there?
if ($registryInstance->instanceExists('user')) {
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\User\UsernameMissingException;
$userInstance = NULL;
// Get a registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry();
// Is the user already there?
if ($registryInstance->instanceExists('user')) {
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get a user instance for comparison
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
// Is the user account confirmed?
if ((!$userInstance->isConfirmed()) && (!$userInstance->isGuest()) && ($requestInstance->getRequestElement('action') != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('action_status_problem'))) {
use Org\Mxchange\CoreFramework\Factory\User\UserFactory;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
}
// Add this instance to registry
- GenericRegistry::getRegistry()->addInstance('user', $userInstance);
+ ObjectRegistry::getRegistry()->addInstance('user', $userInstance);
}
}
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
// Import SPL stuff
try {
// Get the required instance
- $this->valueInstance = GenericRegistry::getRegistry()->getInstance($registryKey);
+ $this->valueInstance = ObjectRegistry::getRegistry()->getInstance($registryKey);
} catch (NullPointerException $e) {
// Not set in registry
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: registryKey=%s returned no instance (NPE thrown)', $registryKey));
if (!is_null($extraKey)) {
try {
// Get the extra instance.
- $this->extraInstance = GenericRegistry::getRegistry()->getInstance($extraKey);
+ $this->extraInstance = ObjectRegistry::getRegistry()->getInstance($extraKey);
} catch (NullPointerException $e) {
// Try to create it
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HELPER: extraKey=%s returned no instance (NPE thrown), this->valueInstance[]=%s', $extraKey, gettype($this->valueInstance)));
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
// Import SPL stuff
try {
// Get last executed pre filter
- $extraInstance = GenericRegistry::getRegistry()->getInstance('extra');
+ $extraInstance = ObjectRegistry::getRegistry()->getInstance('extra');
} catch (NullPointerException $e) {
// Instance in registry is not set (NULL)
// @TODO We need to log this later
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\ObjectArray\FrameworkArrayObject;
use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
// Import SPL stuff
use \InvalidArgumentException;
use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
-use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Traits\Iterator\IteratorTrait;
// Init generic arrays
$this->initGenericArrayGroup('registry', 'generic');
- $this->initGenericArrayGroup('registry', 'instance');
// Trace message
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-REGISTRY: EXIT!');
return $iteratorInstance;
}
- /**
- * Checks whether an instance key was found
- *
- * @param $instanceKey The key holding an instance in registry
- * @return $exists Whether the key exists in registry
- * @throws InvalidArgumentException If a paramter has an invalid value
- */
- public function instanceExists (string $instanceKey) {
- // Check parameter
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: instanceKey=%s - CALLED!', $instanceKey));
- if (empty($instanceKey)) {
- // Throw IAE
- throw new InvalidArgumentException('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
- }
-
- // Does this key exists?
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: Invoking this->isGenericArrayKeySet(registry, instance, %s) ...', $instanceKey));
- $exists = $this->isGenericArrayKeySet('registry', 'instance', $instanceKey);
-
- // Return the result
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: exists=%d - EXIT!', intval($exists)));
- return $exists;
- }
-
- /**
- * Adds/overwrites a new instance to the registry at the given key
- *
- * @param $instanceKey The key to identify the instance
- * @param $objectInstance An instance we shall store
- * @return void
- * @throws InvalidArgumentException If a paramter has an invalid value
- */
- public function addInstance (string $instanceKey, Registerable $objectInstance) {
- // Check parameter
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: instanceKey=%s,objectInstance=%s - CALLED!', $instanceKey, $objectInstance->__toString()));
- if (empty($instanceKey)) {
- // Throw IAE
- throw new InvalidArgumentExeption('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
- }
-
- // Set entry in generic array
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: Invoking this->setGenericArrayKey(registry,instance,%s,%s) ...', $instanceKey, $objectInstance->__toString()));
- $this->setGenericArrayKey('registry', 'instance', $instanceKey, $objectInstance);
-
- // Trace message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-REGISTRY: EXIT!');
- }
-
/**
* Getter for whole generic registry
*
return $this->getGenericSubArray('registry', 'generic');
}
- /**
- * Getter for whole instance registry
- *
- * @return $instanceRegistry The whole instance registry array
- */
- public final function getInstanceRegistry () {
- return $this->getGenericSubArray('registry', 'instance');
- }
-
/**
* Adds a new entry to the given list name. If you want to add objects
* please use addInstance() and getInstance() instead.
return $entry;
}
- /**
- * Gets a registered instance or null if not found
- *
- * @param $instanceKey The key to identify the instance
- * @return $objectInstance An instance we shall store
- * @throws InvalidArgumentException If a paramter has an invalid value
- * @throws NullPointerException If the requested key is not found
- */
- public function getInstance (string $instanceKey) {
- // Check parameter
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: instanceKey=%s - CALLED!', $instanceKey));
- if (empty($instanceKey)) {
- // Throw IAE
- throw new InvalidArgumentException('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
- }
-
- // Is the instance there?
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: Invoking this->instanceExists(%s) ...', $instanceKey));
- if (!$this->instanceExists($instanceKey)) {
- // This might happen if a non-registered key was requested
- throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
- }
-
- // Get the instance
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: Invoking this->getGenericArrayKey(registry,instance,%s) ...', $instanceKey));
- $objectInstance = $this->getGenericArrayKey('registry', 'instance', $instanceKey);
-
- // Return the result
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-REGISTRY: objectInstance=%s - EXIT!', $objectInstance->__toString()));
- return $objectInstance;
- }
-
/**
* "Getter" for a registry key for given prefix and array. This method
* calls implode() to get a suitable key. This method does not care about
--- /dev/null
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Registry\Object;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Registry\BaseRegistry;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+
+// Import SPL stuff
+use \InvalidArgumentException;
+
+/**
+ * A registry for several data types and objects. Objects should be added by
+ * addInstance() and therefore must implement the interface Registerable.
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ObjectRegistry extends BaseRegistry implements ObjectRegister {
+ /**
+ * Instance of this class
+ */
+ private static $registryInstance = NULL;
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ private function __construct () {
+ // Call parent constructor
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('OBJECT-REGISTRY: CONSTRUCTED!');
+ parent::__construct(__CLASS__);
+
+ // Init own array
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('OBJECT-REGISTRY: Invoking this->initGenericArrayGroup(registry,instance) ...');
+ $this->initGenericArrayGroup('registry', 'instance');
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('OBJECT-REGISTRY: EXIT!');
+ }
+
+ /**
+ * Singleton getter for self instance. This class has no factory pattern
+ * because here is no need for special parameters.
+ *
+ * @return $registryInstance Instance of this class
+ */
+ public static final function getRegistry () {
+ // Is an instance there?
+ if (is_null(self::$registryInstance)) {
+ // Not yet, so create one
+ self::$registryInstance = new ObjectRegistry();
+ }
+
+ // Return the instance
+ return self::$registryInstance;
+ }
+
+ /**
+ * Checks whether an instance key was found
+ *
+ * @param $instanceKey The key holding an instance in registry
+ * @return $exists Whether the key exists in registry
+ * @throws InvalidArgumentException If a paramter has an invalid value
+ */
+ public function instanceExists (string $instanceKey) {
+ // Check parameter
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: instanceKey=%s - CALLED!', $instanceKey));
+ if (empty($instanceKey)) {
+ // Throw IAE
+ throw new InvalidArgumentException('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+ }
+
+ // Does this key exists?
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: Invoking this->isGenericArrayKeySet(registry, instance, %s) ...', $instanceKey));
+ $exists = $this->isGenericArrayKeySet('registry', 'instance', $instanceKey);
+
+ // Return the result
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: exists=%d - EXIT!', intval($exists)));
+ return $exists;
+ }
+
+ /**
+ * Getter for whole instance registry
+ *
+ * @return $instanceRegistry The whole instance registry array
+ */
+ public final function getInstanceRegistry () {
+ return $this->getGenericSubArray('registry', 'instance');
+ }
+
+ /**
+ * Adds/overwrites a new instance to the registry at the given key
+ *
+ * @param $instanceKey The key to identify the instance
+ * @param $objectInstance An instance we shall store
+ * @return void
+ * @throws InvalidArgumentException If a paramter has an invalid value
+ */
+ public function addInstance (string $instanceKey, Registerable $objectInstance) {
+ // Check parameter
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: instanceKey=%s,objectInstance=%s - CALLED!', $instanceKey, $objectInstance->__toString()));
+ if (empty($instanceKey)) {
+ // Throw IAE
+ throw new InvalidArgumentExeption('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+ }
+
+ // Set entry in generic array
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: Invoking this->setGenericArrayKey(registry,instance,%s,%s) ...', $instanceKey, $objectInstance->__toString()));
+ $this->setGenericArrayKey('registry', 'instance', $instanceKey, $objectInstance);
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('OBJECT-REGISTRY: EXIT!');
+ }
+
+ /**
+ * Gets a registered instance or null if not found
+ *
+ * @param $instanceKey The key to identify the instance
+ * @return $objectInstance An instance we shall store
+ * @throws InvalidArgumentException If a paramter has an invalid value
+ * @throws NullPointerException If the requested key is not found
+ */
+ public function getInstance (string $instanceKey) {
+ // Check parameter
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: instanceKey=%s - CALLED!', $instanceKey));
+ if (empty($instanceKey)) {
+ // Throw IAE
+ throw new InvalidArgumentException('Parameter "instanceKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+ }
+
+ // Is the instance there?
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: Invoking this->instanceExists(%s) ...', $instanceKey));
+ if (!$this->instanceExists($instanceKey)) {
+ // This might happen if a non-registered key was requested
+ throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+ }
+
+ // Get the instance
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: Invoking this->getGenericArrayKey(registry,instance,%s) ...', $instanceKey));
+ $objectInstance = $this->getGenericArrayKey('registry', 'instance', $instanceKey);
+
+ // Return the result
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('OBJECT-REGISTRY: objectInstance=%s - EXIT!', $objectInstance->__toString()));
+ return $objectInstance;
+ }
+
+}
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Resolver\BaseResolver;
use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
/**
* A generic request class
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Response\Responseable;
/**
use Org\Mxchange\CoreFramework\Image\BaseImage;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Response\Responseable;
/**
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\Traits\Handler\Io\IoHandlerTrait;
use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
use Org\Mxchange\CoreFramework\Image\BaseImage;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
use Org\Mxchange\CoreFramework\Parser\Parseable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Mailer\DeliverableMail;
use Org\Mxchange\CoreFramework\Parser\Parseable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Menu\RenderableMenu;
use Org\Mxchange\CoreFramework\Parser\Parseable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
use Org\Mxchange\CoreFramework\Traits\Stack\StackableTrait;
use Org\Mxchange\CoreFramework\Factory\Template\XmlTemplateEngineFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
use Org\Mxchange\CoreFramework\Template\Xml\CompileableXmlTemplate;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
interface Register extends FrameworkInterface {
- /**
- * Checks whether an instance key was found
- *
- * @param $instanceKey The key holding an instance in registry
- * @return $exists Whether the key exists in registry
- */
- function instanceExists (string $instanceKey);
-
- /**
- * Adds/overwrites a new instance to the registry at the given key
- *
- * @param $instanceKey The key to identify the instance
- * @param $objectInstance An instance we shall store
- * @return void
- */
- function addInstance (string $instanceKey, Registerable $objectInstance);
/**
* Getter for whole generic registry
*/
function getGenericRegistry ();
- /**
- * Getter for whole instance registry
- *
- * @return $instanceRegistry The whole instance registry array
- */
- function getInstanceRegistry ();
-
/**
* Adds a new entry to the given list name. If you want to add objects
* please use addInstance() and getInstance() instead.
*/
function getArrayFromKey (string $arrayKey, string $lookFor);
- /**
- * Gets a registered instance or null if not found
- *
- * @param $instanceKey The key to identify the instance
- * @return $objectInstance An instance we shall store
- * @throws NullPointerException If the requested key is not found
- */
- function getInstance (string $instanceKey);
-
}
--- /dev/null
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Registry\Object;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Registry\Register;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+
+/**
+ * An interface for registries
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface ObjectRegister extends Register {
+ /**
+ * Checks whether an instance key was found
+ *
+ * @param $instanceKey The key holding an instance in registry
+ * @return $exists Whether the key exists in registry
+ */
+ function instanceExists (string $instanceKey);
+
+ /**
+ * Adds/overwrites a new instance to the registry at the given key
+ *
+ * @param $instanceKey The key to identify the instance
+ * @param $objectInstance An instance we shall store
+ * @return void
+ */
+ function addInstance (string $instanceKey, Registerable $objectInstance);
+
+ /**
+ * Getter for whole instance registry
+ *
+ * @return $instanceRegistry The whole instance registry array
+ */
+ function getInstanceRegistry ();
+
+ /**
+ * Gets a registered instance or null if not found
+ *
+ * @param $instanceKey The key to identify the instance
+ * @return $objectInstance An instance we shall store
+ * @throws NullPointerException If the requested key is not found
+ */
+ function getInstance (string $instanceKey);
+
+}
use Org\Mxchange\CoreFramework\Command\Commandable;
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
use Org\Mxchange\CoreFramework\Response\Responseable;
self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: --- Starting tests ... ---');
// Get controller
- $controllerInstance = GenericRegistry::getRegistry()->getInstance('controller');
+ $controllerInstance = ObjectRegistry::getRegistry()->getInstance('controller');
// Run all tests
$controllerInstance->executeTestsFilters($requestInstance, $responseInstance);