PHP 인터페이스 Kraken\Container\ServiceRegisterInterface

파일 보기 프로젝트 열기: kraken-php/framework

공개 메소드들

메소드 설명
boot ( ) Boot service register.
flushAliases ( ) Flush all registered aliases.
flushProviders ( ) Flush all registered providers.
getAlias ( string $alias ) : null | string Return target of given alias. If the alias is not found null will be returned.
getAliases ( ) : string[] Return list of all aliases and its targets in form of associative array.
getProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) : Kraken\Container\ServiceProviderInterface | null Get registered ServiceProvider.
getProviders ( ) : string[] Gets list with classNames of all registered ServiceProvider.
getServices ( ) : string[] Gets list with classNames of all provided services.
registerAlias ( string $alias, string $existing ) Register service alias.
registerProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) Register ServiceProvider.
unregisterAlias ( string $alias ) Unregister previously registered service alias.
unregisterProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) Unregister previously registered ServiceProvider.

메소드 상세

boot() 공개 메소드

On boot the following operations will be made: 1. existing providers will be sorted to resolve its dependency trees. 2. all providers will be registered meaning ::register() method will be fired on each of them. 3. all providers will be booted meaning ::boot() method will be fired on each of them. 4. existing aliases will be registered. ExecutionException is thrown if any of this steps fails.
public boot ( )

flushAliases() 공개 메소드

This method flushes all registered aliases, if register is not booted. If the flush method is called after that the IllegalCallException will be thrown.
public flushAliases ( )

flushProviders() 공개 메소드

This method flushes all registered providers, if they were not booted. If the flush method is called after that the IllegalCallException will be thrown.
public flushProviders ( )

getAlias() 공개 메소드

Return target of given alias. If the alias is not found null will be returned.
public getAlias ( string $alias ) : null | string
$alias string
리턴 null | string

getAliases() 공개 메소드

Return list of all aliases and its targets in form of associative array.
public getAliases ( ) : string[]
리턴 string[]

getProvider() 공개 메소드

The $provider might be concrete object implementing ServiceProviderInterface or string representing the className. In both situations ServiceRegister will look up for already registered Provider of the same class and return it. If the object is not found, null will be returned.
public getProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) : Kraken\Container\ServiceProviderInterface | null
$provider Kraken\Container\ServiceProviderInterface | string
리턴 Kraken\Container\ServiceProviderInterface | null

getProviders() 공개 메소드

Gets list with classNames of all registered ServiceProvider.
public getProviders ( ) : string[]
리턴 string[]

getServices() 공개 메소드

Gets list with classNames of all provided services.
public getServices ( ) : string[]
리턴 string[]

registerAlias() 공개 메소드

ExecutionException is thrown if Container::alias() method underneath throws any errors or exceptions. ResourceOccupiedException is thrown if alias is already registered.
public registerAlias ( string $alias, string $existing )
$alias string
$existing string

registerProvider() 공개 메소드

The $provider might be concrete object implementing ServiceProviderInterface or string representing the className. In latter case, the object will be automatically created by ServiceRegister. If the provider is registered before boot its register method will be added to the queue of handlers to fire on boot. On the other hand, if register is registered after boot, its register method will be fired immediately. ExecutionException is thrown if register handler of ServiceProvider has thrown any exception or error. InvalidArgumentException is thrown if invalid Provider object or class was passed. ResourceOccupiedException is thrown if Provider of given class was already registered.
public registerProvider ( Kraken\Container\ServiceProviderInterface | string $provider )
$provider Kraken\Container\ServiceProviderInterface | string

unregisterAlias() 공개 메소드

ResourceUndefinedException is thrown if alias is not registered.
public unregisterAlias ( string $alias )
$alias string

unregisterProvider() 공개 메소드

The $provider might be concrete object implementing ServiceProviderInterface or string representing the className. In both situations ServiceRegister will look up for already registered Provider of the same class and unregister it. InvalidArgumentException is thrown if invalid Provider object or class was passed. ResourceUndefinedException is thrown if Provider of given class was not found.
public unregisterProvider ( Kraken\Container\ServiceProviderInterface | string $provider )
$provider Kraken\Container\ServiceProviderInterface | string