PHP Class XStatic\ProxyManager

Mostra file Open project: jeremeamia/xstatic Class Usage Examples

Public Methods

Method Description
__construct ( Interop\Container\ContainerInterface $container, xstatic\AliasLoaderInterface $aliasLoader = null )
addProxy ( string $alias, string $proxyFqcn ) Adds a Static Proxy class by delegating to the Alias Loader
enable ( boolean | string $rootNamespace = self::ROOT_NAMESPACE_GLOBAL ) : boolean Enables the Static Proxies by injecting the Container object and registering the Alias Loader for autoloading
setContainer ( Interop\Container\ContainerInterface $container ) Sets the Container object that provides the actual subjects' instances

Method Details

__construct() public method

public __construct ( Interop\Container\ContainerInterface $container, xstatic\AliasLoaderInterface $aliasLoader = null )
$container Interop\Container\ContainerInterface Container that holds the actual instances
$aliasLoader xstatic\AliasLoaderInterface Alias Loader object that stores and resolves

addProxy() public method

Adds a Static Proxy class by delegating to the Alias Loader
public addProxy ( string $alias, string $proxyFqcn )
$alias string Alias to associate with the Static Proxy class
$proxyFqcn string FQCN of the Static Proxy class

enable() public method

Enables the Static Proxies by injecting the Container object and registering the Alias Loader for autoloading
See also: XStatic\AliasLoaderInterface::register()
public enable ( boolean | string $rootNamespace = self::ROOT_NAMESPACE_GLOBAL ) : boolean
$rootNamespace boolean | string The namespace that the alias should be created in
return boolean

setContainer() public method

Sets the Container object that provides the actual subjects' instances
public setContainer ( Interop\Container\ContainerInterface $container )
$container Interop\Container\ContainerInterface Instance of a Container (or Service Locator)