]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2023 08:49:01 +0000 (09:49 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2023 08:49:01 +0000 (09:49 +0100)
- introduced ObjectRegister (interface) and ObjectRegistry (class) for
  instance-registry related stuff

59 files changed:
framework/bootstrap/class_FrameworkBootstrap.php
framework/main/classes/class_BaseFrameworkSystem.php
framework/main/classes/commands/class_BaseCommand.php
framework/main/classes/commands/html/class_HtmlConfirmCommand.php
framework/main/classes/commands/html/class_HtmlHomeCommand.php
framework/main/classes/commands/html/class_HtmlLoginAreaCommand.php
framework/main/classes/commands/html/class_HtmlLoginCommand.php
framework/main/classes/commands/html/class_HtmlLoginFailedCommand.php
framework/main/classes/commands/html/class_HtmlLogoutCommand.php
framework/main/classes/commands/html/class_HtmlLogoutDoneCommand.php
framework/main/classes/commands/html/class_HtmlProblemCommand.php
framework/main/classes/commands/html/class_HtmlRegisterCommand.php
framework/main/classes/commands/html/class_HtmlResendLinkCommand.php
framework/main/classes/commands/image/class_ImageCodeCaptchaCommand.php
framework/main/classes/controller/class_BaseController.php
framework/main/classes/factories/client/class_ClientFactory.php
framework/main/classes/factories/database/class_DatabaseFrontendFactory.php
framework/main/classes/factories/index/class_FileStackIndexFactory.php
framework/main/classes/factories/login/class_LoginFactory.php
framework/main/classes/factories/registry/class_SocketRegistryFactory.php
framework/main/classes/factories/stacks/class_FileStackFactory.php
framework/main/classes/factories/user/class_UserFactory.php
framework/main/classes/factories/xml/class_XmlTemplateEngineFactory.php
framework/main/classes/filter/auth/class_UserAuthFilter.php
framework/main/classes/filter/change/class_EmailChangeFilter.php
framework/main/classes/filter/change/class_PasswordChangeFilter.php
framework/main/classes/filter/news/class_NewsDownloadFilter.php
framework/main/classes/filter/payment/class_PaymentDiscoveryFilter.php
framework/main/classes/filter/update/class_UserStatusConfimedUpdateFilter.php
framework/main/classes/filter/update/class_UserUpdateFilter.php
framework/main/classes/filter/validator/class_EmailValidatorFilter.php
framework/main/classes/filter/validator/class_UserNameValidatorFilter.php
framework/main/classes/filter/verifier/class_AccountPasswordVerifierFilter.php
framework/main/classes/filter/verifier/class_ConfirmCodeVerifierFilter.php
framework/main/classes/filter/verifier/class_UserGuestVerifierFilter.php
framework/main/classes/filter/verifier/class_UserNameVerifierFilter.php
framework/main/classes/filter/verifier/class_UserStatusVerifierFilter.php
framework/main/classes/filter/verifier/class_UserUnconfirmedVerifierFilter.php
framework/main/classes/helper/class_BaseHelper.php
framework/main/classes/helper/html/forms/class_HtmlFormHelper.php
framework/main/classes/helper/html/links/class_HtmlLinkHelper.php
framework/main/classes/language/class_LanguageSystem.php
framework/main/classes/menu/class_BaseMenu.php
framework/main/classes/registry/class_BaseRegistry.php
framework/main/classes/registry/object/class_ObjectRegistry.php [new file with mode: 0644]
framework/main/classes/resolver/controller/class_BaseControllerResolver.php
framework/main/classes/response/class_BaseResponse.php
framework/main/classes/response/html/class_HtmlResponse.php
framework/main/classes/response/image/class_ImageResponse.php
framework/main/classes/template/class_BaseTemplateEngine.php
framework/main/classes/template/console/class_ConsoleTemplateEngine.php
framework/main/classes/template/html/class_HtmlTemplateEngine.php
framework/main/classes/template/image/class_ImageTemplateEngine.php
framework/main/classes/template/mail/class_MailTemplateEngine.php
framework/main/classes/template/menu/class_MenuTemplateEngine.php
framework/main/classes/template/xml/class_BaseXmlTemplateEngine.php
framework/main/interfaces/registry/class_Register.php
framework/main/interfaces/registry/object/class_ObjectRegister.php [new file with mode: 0644]
framework/main/tests/commands/console/class_TestsConsoleMainCommand.php

index 65b017a9fe61e03a4a5433c9ffbe38dfc975d823..f58a492d495dda16241488f347c9cdc993d42c45 100644 (file)
@@ -17,7 +17,6 @@ use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 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;
index ca6a7f0938baa02265b0642d708a29ca4a30f029..79380a2337995bf63140f6fafd2f1ea9b486b41a 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 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;
@@ -417,7 +417,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @return      void
         */
        public final function setWebOutputInstance (OutputStreamer $webInstance) {
-               GenericRegistry::getRegistry()->addInstance('web_output', $webInstance);
+               ObjectRegistry::getRegistry()->addInstance('web_output', $webInstance);
        }
 
        /**
@@ -426,7 +426,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         * @return      $webOutputInstance - Instance to class WebOutput
         */
        public final function getWebOutputInstance () {
-               return GenericRegistry::getRegistry()->getInstance('web_output');
+               return ObjectRegistry::getRegistry()->getInstance('web_output');
        }
 
        /**
index 9ccf50cc224e91d93b216c9429f7059974876038..b31b1cb841d07b61a0dc04f286d7241bc4567b11 100644 (file)
@@ -8,7 +8,6 @@ use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 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;
index 423ba69d081f0699552014e5261a599bd09789e8..93eee3bbcfafcc9e3edacb74dbcd7fd3b7ab0c64 100644 (file)
@@ -11,7 +11,7 @@ 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\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;
@@ -114,7 +114,7 @@ class HtmlConfirmCommand extends BaseCommand implements Commandable {
 
                // 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');
index 6ff23f1f0b038b2859659611fc9d1f618cc367c8..e532c2d2b329505f3fc1a604212895b4de9a1acf 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 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;
index 48b0df60bebef67142259b4ace46750c6e6befe4..0b122fe2187e58275eb8aa0a90d0a73ee495d7e1 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 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;
@@ -92,7 +92,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable {
         */
        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) {
@@ -200,7 +200,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable {
                $actionInstance->addExtraFilters($controllerInstance, $requestInstance);
 
                // Remember this action in registry
-               GenericRegistry::getRegistry()->addInstance('action', $actionInstance);
+               ObjectRegistry::getRegistry()->addInstance('action', $actionInstance);
        }
 
 }
index 3227d934528763f4d10cf1ddb404be8efe51d677..2c6527360528f54326bc66de477677cf047f6e69 100644 (file)
@@ -9,7 +9,7 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 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;
@@ -73,7 +73,7 @@ class HtmlLoginCommand extends BaseCommand implements Commandable {
         */
        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();
index fd9c770cfeac6f71712780748e05d2da9577c07c..e64f6ec09a1aff31a99322487dc0433b22b2e69b 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 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;
index fb3ebdf651b434b7c9f3cb3dc87aeef366f7d45c..9951a262b3a8841b8bc37cfd0a515f75aa638575 100644 (file)
@@ -7,7 +7,6 @@ use Org\Mxchange\CoreFramework\Command\BaseCommand;
 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;
index 6669e6bec9616fc20931abefc56388348ed2c39e..b70a9d4cdbc4bad3844ae87a88efd5d204715de3 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 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;
index 1b876f7b8577def99ccbc0f790633aaeb988869c..c6f35a7274f4fbc946acd605efcbcd3bfa38374e 100644 (file)
@@ -7,7 +7,6 @@ use Org\Mxchange\CoreFramework\Command\BaseCommand;
 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;
index 8e0669af9c074ca6e58316b5d4757be4938ab49f..a805930cde85c576c38b2028a7e6234e21c8df95 100644 (file)
@@ -9,7 +9,7 @@ use Org\Mxchange\CoreFramework\Command\Commandable;
 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;
@@ -73,7 +73,7 @@ class HtmlRegisterCommand extends BaseCommand implements Commandable {
         */
        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();
index 1506ebe7f2687b6ae1756ac41e18ecb7449993b2..dd0b683edfe1f7128a9fd3ed96f2d2a7a389eb5a 100644 (file)
@@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Controller\Controller;
 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;
@@ -74,7 +74,7 @@ class HtmlResendLinkCommand extends BaseCommand implements Commandable {
         */
        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();
index 15f07d7540c5755a657aa14638943da192f60d05..0491a9525d4c3bd31403b8c37227a935e55419a4 100644 (file)
@@ -7,7 +7,6 @@ use Org\Mxchange\CoreFramework\Command\BaseCommand;
 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;
index 0097720b2112691cc45f43c4d8ec8da95af109be..8067fcbafe7094a712c28b08acad194a297d6f36 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Chain\Filter\InvalidFilterChainException;
 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;
@@ -68,7 +68,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl
                $this->initFilterChain(self::FILTER_CHAIN_POST_COMMAND);
 
                // Add this controller to the registry
-               GenericRegistry::getRegistry()->addInstance('controller', $this);
+               ObjectRegistry::getRegistry()->addInstance('controller', $this);
        }
 
        /**
index 339f076dbbc36cbc433cf1315c58ef98cfc610d7..19248724641d73e6f6bf160125deb00fb2e4770e 100644 (file)
@@ -55,9 +55,9 @@ class ClientFactory extends BaseFactory {
                $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);
@@ -66,7 +66,7 @@ class ClientFactory extends BaseFactory {
                        $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
index 741637ccd4c0cece1bf06e341ca146d70d4f4ac7..90ea3e2e40a09c6091e727d141262e08c9c2f306 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\Factory\Database\Frontend;
 // 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
@@ -49,7 +49,7 @@ class DatabaseFrontendFactory extends BaseFactory {
         */
        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)) {
index b72188c4ec611e032f949c559ed14ca2ee06443d..ad29daa3fd27b2989a6edc5c88dcc09e93e6881a 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Factory\Stack\File;
 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;
@@ -57,15 +57,15 @@ class FileStackIndexFactory extends BaseFactory {
                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
index cd7265de00ba3a5df3e22c38c74b12242fefbce4..f668e726ba6094f07fe34951a01c4bdf947e63bc 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\Factory\Login;
 // 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;
 
 /**
@@ -49,7 +49,7 @@ class LoginFactory extends BaseFactory {
         */
        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')) {
index 62d74235cd31915e33abac826f13e5ffbb8b16d1..13cc619a79955fd4e5af9f0bdcbcf073e41b1a43 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\Factory\Registry\Socket;
 // 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
@@ -49,7 +49,7 @@ class SocketRegistryFactory extends BaseFactory {
         */
        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')) {
index e40cc5713dd77fb82ce5cb2c68adb33e3433af32..9691a6ed7d135ffb0e59e45719b4ab1d32e55aba 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
@@ -73,15 +73,15 @@ class FileStackFactory extends BaseFactory {
                ));
 
                // 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
index e041351e59ae6fdcdf5788da845e0478a17b1584..4582152545dd911196e8c44fb3da9eef6ac4a1bb 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\Factory\User;
 // 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;
 
 /**
@@ -49,7 +49,7 @@ class UserFactory extends BaseFactory {
         */
        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')) {
index 24ff87fbeb61853a745eea61bf4df504571217ee..f6b5bda63057f056e847ad5f7c15b8dd3b8d192f 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Factory\Template;
 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;
@@ -63,9 +63,9 @@ class XmlTemplateEngineFactory extends BaseFactory {
                }
 
                // 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);
@@ -80,7 +80,7 @@ class XmlTemplateEngineFactory extends BaseFactory {
                        $templateInstance->enableXmlCompacting();
 
                        // Set the instance in registry for further use
-                       GenericRegistry::getRegistry()->addInstance($configKey, $templateInstance);
+                       ObjectRegistry::getRegistry()->addInstance($configKey, $templateInstance);
                }
 
                // Return the instance
index 11422845ed5ab9e17c00304782680212c9bb1be8..d909bd214dd4233c42a28a223eed5187b70a76cd 100644 (file)
@@ -9,7 +9,7 @@ use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 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;
@@ -131,7 +131,7 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                }
 
                // 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) {
@@ -140,8 +140,8 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                }
 
                // 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);
        }
 
 }
index a8411e705b9f90ef5d7f8c5667031b55b20d8a8c..25e4729db57e220878c1cdd7b2be0f3e3fbdbbd1 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 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;
 
@@ -114,7 +114,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                }
 
                // 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');
index 7eaaa2ee0bc14e17e01803bb7bb8ed20e4b8b131..8a011d0788521cd5d30742fd3175873a6bd7f435 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 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;
 
@@ -115,7 +115,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
                }
 
                // 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.');
index c5e125139b206bedcdcf233679349cc3ced0561d..c4323697548a7cee54d4c775da45675485f8822d 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Filter\News;
 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;
 
@@ -70,7 +70,7 @@ class NewsDownloadFilter extends BaseFilter implements Filterable {
                $newsInstance = HtmlNewsFactory::createFactoryByRequest($requestInstance);
 
                // Store the news instance in registry
-               GenericRegistry::getRegistry()->addInstance('news', $newsInstance);
+               ObjectRegistry::getRegistry()->addInstance('news', $newsInstance);
        }
 
 }
index 14046dc873a3cc9ca1144df189c00910a51863f1..c89e7d312dc7d461c0eb4c86e098dc8526ab64ae 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
 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;
 
@@ -123,7 +123,7 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable {
                        $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);
index c9719eb6edbad43342891916377d5da296d662a1..5d2f1e3589eccc92994bf9c9173b6cc30f8e26a4 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
 
@@ -66,7 +66,7 @@ class UserStatusConfimedUpdateFilter extends BaseFilter implements Filterable {
         */
        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');
index 737d6511a3bf62ea1f79a0ea81e0f2b594492631..cf93249722cc3717ea10c74e095b5f8cee6b5532 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Mxchange\CoreFramework\Filter\User;
 // 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;
 
@@ -66,13 +66,13 @@ class UserUpdateFilter extends BaseFilter implements Filterable {
         */
        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
index f26d9e1e082fc0119153eb5715c95d683504be0d..ab07e8c04fd17b85b0d0de65ea59dcb007ae3678 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
 
@@ -151,7 +151,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                $userInstance = NULL;
 
                // Get a registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry();
 
                // Is the user already there?
                if ($registryInstance->instanceExists('user')) {
index 4a97638fa682083923de1ce22191804dc6c283ad..10bb7f4885f519086bd1945814e646d1189d848e 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
@@ -117,7 +117,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                $userInstance = NULL;
 
                // Get a registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry();
 
                // Is the user already there?
                if ($registryInstance->instanceExists('user')) {
index f5e1056543a4696526ee22f527c4e5c6156d6bea..d06c8211de0ec7f3d840f73f25ded840decf254d 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 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;
@@ -103,7 +103,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Get a user instance
-               $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+               $userInstance = ObjectRegistry::getRegistry()->getInstance('user');
 
                // Get current hash
                $currentHash = $userInstance->getField('pass_hash');
index a83e66ab3273a9b3e7bb80e06c215fa5fac42491..785665fe3550b52a50305b9cfdbad394376dd67a 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 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;
 
@@ -91,7 +91,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // 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);
index a027a3a1464040b49c23ec9d8305a37a449ca4ca..21fcd2179ae3ccf3a291e0ace60707a1e62b7b54 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
 
@@ -119,7 +119,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                $userInstance = NULL;
 
                // Get a registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry();
 
                // Is the user already there?
                if ($registryInstance->instanceExists('user')) {
index 2c19be2e954bf9c0aa57f77301b1294d0ca38648..49562ac48fccaef01e99e45c694b72c39a3ea622 100644 (file)
@@ -7,7 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
@@ -117,7 +117,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                $userInstance = NULL;
 
                // Get a registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry();
 
                // Is the user already there?
                if ($registryInstance->instanceExists('user')) {
index 2d16e7d335e7b36e57f00ec77802ff830303d32c..44f53244539d1c10ea90c42fc0ba5ac2339c64b4 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Filter\Verifier\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;
 
@@ -65,7 +65,7 @@ class UserStatusVerifierFilter extends BaseFilter implements Filterable {
         */
        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'))) {
index 3890515a95c534c5bcf508a62b5f644e49e474d6..53330065336fb607cc96d8e9b572a8c026dfad4b 100644 (file)
@@ -8,7 +8,7 @@ use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 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;
 
@@ -94,7 +94,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Add this instance to registry
-               GenericRegistry::getRegistry()->addInstance('user', $userInstance);
+               ObjectRegistry::getRegistry()->addInstance('user', $userInstance);
        }
 
 }
index ef87c282c934af8ee2472694b0909012a03a274b..4dfac8f3d5d8f007754b11f1fda0e5bb94212bb8 100644 (file)
@@ -7,7 +7,7 @@ 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\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
 // Import SPL stuff
@@ -263,7 +263,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
 
                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));
@@ -274,7 +274,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
                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)));
index 8ec93a697b2b300b19206d6ecc5812105e60eef5..5db5e0414bdf48a62e0c3c47d9675964e30e90db 100644 (file)
@@ -8,7 +8,7 @@ use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 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
@@ -693,7 +693,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
 
                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
index c87cd0c66022f0a4f9ce28e3f38c952001e8e90d..f4b0ffe6fb60e34d4c5537c041ec395474cafa0a 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Configuration\NoConfigEntryException;
 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;
 
index 67f0848059cb6259b7ff678268de37690f5af6d7..44e8801f9b844a986e70737aa4a63709c4420b65 100644 (file)
@@ -10,7 +10,6 @@ use Org\Mxchange\CoreFramework\Localization\ManageableLanguage;
 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;
index 8494e472addffd5ccba6eeff39628fa8cc271a3d..72ed27cff811fd84e77b477ecc6666e42d1e7405 100644 (file)
@@ -8,7 +8,6 @@ use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 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;
 
index a309efdaaa7b8e11583fe6be1c82618318a751fd..f877026bd0cbeb968b6501bc9a8120220053d124 100644 (file)
@@ -5,7 +5,6 @@ namespace Org\Mxchange\CoreFramework\Registry;
 // 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;
 
@@ -58,7 +57,6 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
 
                // Init generic arrays
                $this->initGenericArrayGroup('registry', 'generic');
-               $this->initGenericArrayGroup('registry', 'instance');
 
                // Trace message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-REGISTRY: EXIT!');
@@ -94,54 +92,6 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
                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
         *
@@ -151,15 +101,6 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
                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.
@@ -282,38 +223,6 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg
                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
diff --git a/framework/main/classes/registry/object/class_ObjectRegistry.php b/framework/main/classes/registry/object/class_ObjectRegistry.php
new file mode 100644 (file)
index 0000000..a5b7aa9
--- /dev/null
@@ -0,0 +1,166 @@
+<?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;
+       }
+
+}
index bfea4f879a49e2b5cecbaab3672976957436df99..f60774d82ef0c7b4524b259075f05911fed76886 100644 (file)
@@ -10,7 +10,6 @@ use Org\Mxchange\CoreFramework\Controller\InvalidControllerException;
 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;
index 97dc1b0a3a116457949a27d98cb04540b743e815..33f6efec9746289e7ca8d09f6fae5dadf51b3898 100644 (file)
@@ -6,7 +6,6 @@ namespace Org\Mxchange\CoreFramework\Response;
 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
index b81a30a9f84f6ce187a078b76d529917fc1020ab..5c5beed73b33693a84d647b14b431f1f6f61603d 100644 (file)
@@ -7,7 +7,6 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
 
 /**
index aa25d792eb981e273b16dcc8016b73bbcc8e2f70..783c84894f77d6cbcaa2c5f0f8267865e7274ea5 100644 (file)
@@ -8,7 +8,6 @@ use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 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;
 
 /**
index 9e85c24f5274d39ab41bec072844b51594a92b56..3594bb7b32749811ac8164d8d2dfad0729e1407a 100644 (file)
@@ -12,7 +12,6 @@ use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 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;
index e15a33d882393a679153858971726c3707534574..438e5a398c16b35368022efda513f41cadfeeedb 100644 (file)
@@ -7,7 +7,6 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
 
index 4c5863baaed91e2e8760f2d7c76aef841fe1e2a7..8894b9bbe1ffac7429ab473e865015d4acea28b1 100644 (file)
@@ -7,7 +7,6 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 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;
 
index 92591a985e2b054118e4c6267d7b34544987ddbd..31a011da6426459a28df8ab2b968646f0b2a5507 100644 (file)
@@ -11,7 +11,6 @@ use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 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;
index 1be38d42a16a12f52826f9c807fc17f3eb32cdbf..a54f98d9cbc28c947e57bf7ebe766cdb23f8561d 100644 (file)
@@ -9,7 +9,6 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 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;
index dca4118c3aaf8ff40faa857e2e24cb74be0487e5..e7e932a5849233003447b7b0edc0ed26ff09c1f9 100644 (file)
@@ -10,7 +10,6 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 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;
index 60c7ee6c83866386a8d34a515e309ed28242eb89..2ce4f69316305c4489422f4f3a075a7dd27142c8 100644 (file)
@@ -8,7 +8,6 @@ use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 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;
index 8e2daa03abb118682295a99fce78ca70031364b7..bfda3c3bb7a4dfad9cdb70a33debcb31570f8757 100644 (file)
@@ -28,22 +28,6 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
  * 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
@@ -52,13 +36,6 @@ interface Register extends FrameworkInterface {
         */
        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.
@@ -85,13 +62,4 @@ interface Register extends FrameworkInterface {
         */
        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);
-
 }
diff --git a/framework/main/interfaces/registry/object/class_ObjectRegister.php b/framework/main/interfaces/registry/object/class_ObjectRegister.php
new file mode 100644 (file)
index 0000000..cdc9b8c
--- /dev/null
@@ -0,0 +1,65 @@
+<?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);
+
+}
index 896acbf08d371b14ef35c086b74b23439d9d5789..d8fc1a1cdbdabfac9ae6c2877420b1c869ccbf94 100644 (file)
@@ -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\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;
@@ -74,7 +74,7 @@ class TestsConsoleMainCommand extends BaseCommand implements Commandable {
                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);