PHP Interface Kraken\Core\CoreInterface

Inheritance: extends Kraken\Container\ContainerInterface
Show file Open project: kraken-php/framework Interface Usage Examples

Public Methods

Method Description
boot ( ) : Kraken\Core\CoreInterface Boot core and all of its registered providers and aliases.
config ( string[][] | null $config = null ) : string[][] Add addition configuration to current default configuration.
flushAliases ( ) Flush list of registered aliases.
flushProviders ( ) Flush list of registered providers.
getAlias ( string $alias ) : string | null Get service of passed alias or null if it does not exist.
getAliases ( ) : string[] Get list of all registered aliases.
getBasePath ( ) : string Return directory path to project root.
getDataDir ( ) : string Return directory name of framework data folder.
getDataPath ( ) : string Return directory path to framework data folder.
getProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) : Kraken\Container\ServiceProviderInterface | null Return registered provider or null if not found.
getProviders ( ) : string[] Return list of all registered providers' classNames.
getServices ( ) : string[] Return list of all registered providers' provided services.
getType ( ) : string Return Runtime type of container.
getVersion ( ) : string Return current version of Framework.
registerAlias ( string $alias, string $interface ) Register alias to another service.
registerAliases ( string[] $interfaces ) Register collection of service aliases.
registerProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) Register ServiceProvider.
registerProviders ( Kraken\Container\ServiceProviderInterface[] | string[] $providers ) Register collection of ServiceProviders.
unregisterAlias ( string $alias ) Unregister previously registered alias.
unregisterProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) Unregister ServiceProvider.

Method Details

boot() public method

InstantiationException is thrown if any of providers throws error or exception during boot.
public boot ( ) : Kraken\Core\CoreInterface
return Kraken\Core\CoreInterface

config() public method

Add addition configuration to current default configuration.
public config ( string[][] | null $config = null ) : string[][]
$config string[][] | null
return string[][]

flushAliases() public method

This method flushes list of registered aliases if it is invoked before boot, if it is called after that the IllegalCallException is thrown.
public flushAliases ( )

flushProviders() public method

This method flushes list of registered providers if it is invoked before boot, if it is called after that the IllegalCallException is thrown.
public flushProviders ( )

getAlias() public method

Get service of passed alias or null if it does not exist.
public getAlias ( string $alias ) : string | null
$alias string
return string | null

getAliases() public method

Get list of all registered aliases.
public getAliases ( ) : string[]
return string[]

getBasePath() public method

Return directory path to project root.
public getBasePath ( ) : string
return string

getDataDir() public method

Return directory name of framework data folder.
public getDataDir ( ) : string
return string

getDataPath() public method

Return directory path to framework data folder.
public getDataPath ( ) : string
return string

getProvider() public method

Return registered provider or null if not found.
public getProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) : Kraken\Container\ServiceProviderInterface | null
$provider Kraken\Container\ServiceProviderInterface | string
return Kraken\Container\ServiceProviderInterface | null

getProviders() public method

Return list of all registered providers' classNames.
public getProviders ( ) : string[]
return string[]

getServices() public method

Return list of all registered providers' provided services.
public getServices ( ) : string[]
return string[]

getType() public method

Returned value might be one of: Runtime::UNIT_PROCESS, Runtime::UNIT_THREAD, Runtime::UNIT_UNDEFINED.
public getType ( ) : string
return string

getVersion() public method

Return current version of Framework.
public getVersion ( ) : string
return string

registerAlias() public method

ExecutionException is thrown if any error or exception is thrown in Container during registration.
public registerAlias ( string $alias, string $interface )
$alias string
$interface string

registerAliases() public method

Register collection of service aliases.
public registerAliases ( string[] $interfaces )
$interfaces string[]

registerProvider() public method

Argument for $provider might be concrete object or className for provider to create. ExecutionException is thrown if provider throws error or exception during registration.
public registerProvider ( Kraken\Container\ServiceProviderInterface | string $provider )
$provider Kraken\Container\ServiceProviderInterface | string

registerProviders() public method

Collection of $providers might contain concrete objects or classNames for providers to create. ExecutionException is thrown if any of providers throws error or exception during registration.
public registerProviders ( Kraken\Container\ServiceProviderInterface[] | string[] $providers )
$providers Kraken\Container\ServiceProviderInterface[] | string[]

unregisterAlias() public method

ExecutionException is thrown if any error or exception is thrown in Container during unregistration.
public unregisterAlias ( string $alias )
$alias string

unregisterProvider() public method

Argument for $provider might be concrete object or className for provider. ExecutionException is thrown if provider throws error or exception during unregistration.
public unregisterProvider ( Kraken\Container\ServiceProviderInterface | string $provider )
$provider Kraken\Container\ServiceProviderInterface | string