]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2023 10:44:05 +0000 (11:44 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2023 10:44:05 +0000 (11:44 +0100)
- factory-based registries have their own key space

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

index 7b912e67211c63e3b036a09b0c71ba4864ce133e..3b182f8f7135c9cb99d853fc2014744f615dde34 100644 (file)
@@ -55,9 +55,9 @@ class ClientFactory extends BaseFactory {
                $registryKey = strtolower($protocolInstance->getProtocolName()) . '_client';
 
                // Is the key already in registry?
-               if (ObjectRegistry::getRegistry('generic')->instanceExists($registryKey)) {
+               if (ObjectRegistry::getRegistry('factory')->instanceExists($registryKey)) {
                        // Then use that instance
-                       $clientInstance = ObjectRegistry::getRegistry('generic')->getInstance($registryKey);
+                       $clientInstance = ObjectRegistry::getRegistry('factory')->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
-                       ObjectRegistry::getRegistry('generic')->addInstance($registryKey, $clientInstance);
+                       ObjectRegistry::getRegistry('factory')->addInstance($registryKey, $clientInstance);
                }
 
                // Return the prepared instance
index f5fc0bbd7a649053b49847af8a07c3396cabf815..2448c5b56282ae10c63a7c8c05763cb9e30f1501 100644 (file)
@@ -49,7 +49,7 @@ class DatabaseFrontendFactory extends BaseFactory {
         */
        public static final function createFrontendByConfiguredName (string $frontendName) {
                // Get registry instance
-               $registryInstance = ObjectRegistry::getRegistry('generic');
+               $registryInstance = ObjectRegistry::getRegistry('factory');
 
                // Do we have an instance in the registry?
                if ($registryInstance->instanceExists($frontendName)) {
index e37beb907fb3cb514f8053fd023fec089aabcf30..aa774a1d794ee46395c7af98998e0208d4e3d7e3 100644 (file)
@@ -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 (ObjectRegistry::getRegistry('generic')->instanceExists($type . '_index')) {
+               } elseif (ObjectRegistry::getRegistry('factory')->instanceExists($type . '_index')) {
                        // Get handler from registry
-                       $indexInstance = ObjectRegistry::getRegistry('generic')->getInstance($type . '_index');
+                       $indexInstance = ObjectRegistry::getRegistry('factory')->getInstance($type . '_index');
                } else {
                        // Get the handler instance
                        $indexInstance = ObjectFactory::createObjectByConfiguredName($type . '_file_stack_index_class', [$fileInfoInstance]);
 
                        // Add it to the registry
-                       ObjectRegistry::getRegistry('generic')->addInstance($type . '_index', $indexInstance);
+                       ObjectRegistry::getRegistry('factory')->addInstance($type . '_index', $indexInstance);
                }
 
                // Return the instance
index dc668de0410e42cb0dfad561a9b6d2a9cf3c31ea..f7a2bd370c8dbeca81c9de153816cbc70d1250c9 100644 (file)
@@ -49,7 +49,7 @@ class LoginFactory extends BaseFactory {
         */
        public static final function createLoginObjectByRequest (Requestable $requestInstance) {
                // Get registry instance
-               $registryInstance = ObjectRegistry::getRegistry('generic');
+               $registryInstance = ObjectRegistry::getRegistry('factory');
 
                // Do we have an instance in the registry?
                if ($registryInstance->instanceExists('login_helper')) {
index bed3dafa778a245122268731ba10b0b882560364..b527814ea8d449031e24a4c3f68115ef6526f9be 100644 (file)
@@ -49,7 +49,7 @@ class SocketRegistryFactory extends BaseFactory {
         */
        public static final function createSocketRegistryInstance () {
                // Get registry instance
-               $registryInstance = ObjectRegistry::getRegistry('generic');
+               $registryInstance = ObjectRegistry::getRegistry('factory');
 
                // Do we have an instance in the registry?
                if ($registryInstance->instanceExists('socket_registry')) {
index 92a5158bb573b57d7aa5dc64862b09d21e3ff1da..32d6326f159d3c9743628c1f10f2b41af82f5f2e 100644 (file)
@@ -73,15 +73,15 @@ class FileStackFactory extends BaseFactory {
                ));
 
                // If there is no handler?
-               if (ObjectRegistry::getRegistry('generic')->instanceExists($stackName . '_stack')) {
+               if (ObjectRegistry::getRegistry('factory')->instanceExists($stackName . '_stack')) {
                        // Get handler from registry
-                       $stackInstance = ObjectRegistry::getRegistry('generic')->getInstance($stackName . '_stack');
+                       $stackInstance = ObjectRegistry::getRegistry('factory')->getInstance($stackName . '_stack');
                } else {
                        // Get the handler instance
                        $stackInstance = ObjectFactory::createObjectByConfiguredName($prefix . '_' . $stackName . '_stack_class', array($fileInfoInstance, $prefix . '_' . $stackName));
 
                        // Add it to the registry
-                       ObjectRegistry::getRegistry('generic')->addInstance($stackName . '_stack', $stackInstance);
+                       ObjectRegistry::getRegistry('factory')->addInstance($stackName . '_stack', $stackInstance);
                }
 
                // Return the instance
index 6fc42a6c6c6cefc67bcf03cb7db1d8a1afa1de43..9aeb0588c7737b938bf131c3ee21f50d3e899dae 100644 (file)
@@ -49,7 +49,7 @@ class UserFactory extends BaseFactory {
         */
        public static final function createUserByRequest (Requestable $requestInstance) {
                // Get registry instance
-               $registryInstance = ObjectRegistry::getRegistry('generic');
+               $registryInstance = ObjectRegistry::getRegistry('factory');
 
                // Do we have an instance in the registry?
                if ($registryInstance->instanceExists('user')) {
index 18b85097994e65957e06d42761d5fbd3f4fddd85..f29e271bd03993b01d34acccc5a4e19d380618a0 100644 (file)
@@ -63,9 +63,9 @@ class XmlTemplateEngineFactory extends BaseFactory {
                }
 
                // Do we have an instance in the registry?
-               if (ObjectRegistry::getRegistry('generic')->instanceExists($configKey)) {
+               if (ObjectRegistry::getRegistry('factory')->instanceExists($configKey)) {
                        // Then use this instance
-                       $templateInstance = ObjectRegistry::getRegistry('generic')->getInstance($configKey);
+                       $templateInstance = ObjectRegistry::getRegistry('factory')->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
-                       ObjectRegistry::getRegistry('generic')->addInstance($configKey, $templateInstance);
+                       ObjectRegistry::getRegistry('factory')->addInstance($configKey, $templateInstance);
                }
 
                // Return the instance