Remote PSR-11 Container Client

Data as from INI-Parse Description (RDAP-EXT)
{
    "'": {
        "": ">isset($container),"
    }
}

Go back Parent node: PHP Namespaces

IO4FallbackContainerClient.php

Description

Remote PSR-11 Container Client.

Example:

 

1. Container Server:

<?php 
namespace{	
 use ProxyManager\Factory\RemoteObject\Adapter\JsonRpc;
 use ProxyManager\Factory\RemoteObjectFactory;
 use Laminas\Http\Client\Adapter\Exception\RuntimeException;
 use Laminas\Json\Server\Client;
 use Laminas\Json\Json;
use Laminas\Json\Server\Server;
	
	
 $StubRunner = require __DIR__.\DIRECTORY_SEPARATOR.'index.php';	 
 $StubRunner->autoloading();
	
 class IO4FallbackContainer  
{
	protected $container;
	public function __construct(?array $definitions = [], ?array $options = []){
		$class = \Webfan\Webfat\App\ContainerCollection::class;
	    $this->container= new $class(array_merge([], $definitions),
				    array_merge(['onFalseGet'=>\IO4\Container\ContainerCollectionInterface::NULL_ONERROR,], $options)['onFalseGet'],
				    array_merge(['callId'=>\IO4\Container\ContainerCollectionInterface::CALL_ID,],
						$options)['callId']);	
	}
	 
	 
    public function containerGetHas($method='has', $id) 
    {  
		$args = func_get_args();
		array_shift($args);
		if('has'===$method){
			return \call_user_func_array([$this,'container'.ucfirst($method)],$args);
		}elseif('get'===$method){
			return \call_user_func_array([$this,'container'.ucfirst($method)],$args);
		}else{
		  return \call_user_func_array([$this,'container'.ucfirst($method)],$args);	
		}
    }	
    protected function containerGet($id) 
    { 
	
		   switch($id){
			//case 'test id 123 from: ' :
			//	$r = true;
			//break;
			default:
				 return $this->container->get($id);
				break;
		}
		
    }
	 
	protected function containerHas($id)
    { 
		$r = false;
		switch($id){
		//	case 'test id 123 from: ' :
			//	$r = true;
		//	break;
			default:
				 $r = $this->container->has($id);
				break;
		}
		return ['has'=>$r];
    }	 
}
  

(static function () : void {
    $server = new Server();
//$server->setClass('Foo', 'FooServiceInterface');  // my FooServiceInterface implementation
    $server->setClass(new IO4FallbackContainer([
		  'test id 123 from: '=> [function(\Psr\Container\ContainerInterface $container, $previous = null) {
			return ['message'=>' from remote ',
				//'keycount'=>count($this->container->getKnownEntryNames()),
				'keycount'=>0,
				'isContainer'=>isset($container), 
			   ];
		  }, 'factory'], 	
	]), IO4FallbackContainer::class);
    $server->setReturnResponse(false);

    $server->handle();
})();
	
}//ns

2. Container Server Client (from webfats stub Default Container):

<?php

 $StubRunner = require __DIR__.\DIRECTORY_SEPARATOR.'index.php';	 
  $StubRunner->autoloading();
 $StubRunner->autoUpdateStub();
 
(static function ($StubRunner) : void {
	    try {
        var_dump($StubRunner->getAsContainer(null)->get('test id 123 from: ')); // bar remote !
    } catch (\Laminas\Http\Client\Adapter\Exception\RuntimeException $error) {
        echo $error->getMessage();

        exit(2);
    }
	
})($StubRunner);

3. Download the index.php required in the examples above.

 

Uses Transforms...

Registration Authority

Frdlweb Software
E-Mail: software@frdl.de

Source code

Alternative Identifiers

IdentifierDescription
aid:D276000186B200055B35C47168A6799F
(No PIX allowed)
OIDplus Information Object Application Identifier (ISO/IEC 7816) More information
guid:5b35c471-4c62-8000-a6f0-27b67cfbf275OIDplus Information Object Custom UUID (RFC 9562) More information
mac:D2-1F-68-A6-79-9FOIDplus Information Object MAC address, Unicast (AAI)
mac:D3-1F-68-A6-79-9FOIDplus Information Object MAC address, Multicast (AAI)
oid:1.3.6.1.4.1.37476.30.9.1530250353.1755740575OIDplus Information Object OID
x500dn:/​dc=com/​dc=example/​cn=oidplus/​1.3.6.1.4.1.37476.2.5.2.9.4.1=1530250353/​1.3.6.1.4.1.37476.2.5.2.9.4.2=1755740575OIDplus Information Object X.500 DN

CDN/Files
RDAP (internal)
RDAP (local server)
OID-IP: Text, JSON, XML (Documentation)
REST API (Documentation)

Federated OID Info:

  • Handle: @IO4FallbackContainerClient.php
  • Entity running this (Meta-)Node:
  • Application this node runs in:

RDAP OID Registrar/Registrant Authortive Service:

Special AltIds

Share Static link to this page


Deutsch English (USA)
oidplus:system | System
oidplus:login_webfan | Login
oidplus:external_weid_info_home | WEID Consortium
oidplus:external_oid_zone_home | OID Hosting
oidplus:external_webfan_de_home | Webfan
oidplus:external_frdlweb_de_home | Frdlweb
oidplus:home | Home
pen: | IANA Enterprise Numbers
oid: | Object Identifier (OID)
guid: | Globally Unique Identifier (GUID)
other: | Other objects
php: | PHP Namespaces
     php:IO4FallbackContainerClient.php | -- Remote PSR-11 Container Client
circuit: | Circuit Definition
uri: | URI objects
web+fan: | web+fan:// [#@resources]
mac: | MAC adresses (EUI/ELI/AAI/SAI)
ipv4: | IPv4 Network Blocks
ipv6: | IPv6 Network Blocks
java: | Java Package Names
domain: | Domain Names
aid: | Application Identifier (ISO/IEC 7816)
fourcc: | Four-Character-Code (FourCC)
x500dn: | X.500 Distinguished Name
service: | Services
alloc: | Allocation
urn: | Uniform Resource Name (URN)
oidplus:rest_api_documentation | REST API Documentation
oidplus:login | Login
oidplus:whois | OID-IP / WHOIS
oidplus:com.viathinksoft.freeoid | Register a free OID
oidplus:search | Search
oidplus:resources | Documents and Resources
oidplus:webfan_registry_hosting | OID & Registry Hosting
oidplus:contact | Contact administrator