$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);
$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
*/
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)) {
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
*/
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')) {
*/
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')) {
));
// 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
*/
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')) {
}
// 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);
$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