PHP Class eZ\Publish\Core\Base\ServiceContainer

Provides cache generation.
Inheritance: implements eZ\Publish\API\Container
Datei anzeigen Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$bypassCache boolean Holds flag whether cache should be bypassed.
$cacheDir string Holds cache directory path.
$containerClassName string Holds class name for generated container cache.
$debug boolean Holds debug flag for cache service.
$innerContainer Symfony\Component\DependencyInjection\Container | Symfony\Component\DependencyInjection\ContainerBuilder Holds inner Symfony container instance.
$installDir string Holds installation directory path.

Public Methods

Method Description
__construct ( string | Symfony\Component\DependencyInjection\ContainerInterface $container, string $installDir, string $cacheDir, boolean $debug = false, boolean $bypassCache = false )
get ( string $id ) : object Convenience method to inner container.
getInnerContainer ( ) : ContainerBuilder
getParameter ( string $name ) : mixed Convenience method to inner container.
getRepository ( ) : eZ\Publish\API\Repository\Repository Get Repository object.

Protected Methods

Method Description
dumpContainer ( Symfony\Component\Config\ConfigCache $cache ) Dumps the service container to PHP code in the cache.
getContainer ( ) Returns ContainerBuilder by including the default file 'containerBuilder.php' from settings directory.
initializeContainer ( ) Initializes inner container.
prepareDirectory ( string $directory, string $name ) Checks for existence of given $directory and tries to create it if found missing.

Method Details

__construct() public method

public __construct ( string | Symfony\Component\DependencyInjection\ContainerInterface $container, string $installDir, string $cacheDir, boolean $debug = false, boolean $bypassCache = false )
$container string | Symfony\Component\DependencyInjection\ContainerInterface Path to the container file or container instance
$installDir string Installation directory, required by default 'containerBuilder.php' file
$cacheDir string Directory where PHP container cache will be stored
$debug boolean Default false should be used for production, if true resources will be checked and cache will be regenerated if necessary
$bypassCache boolean Default false should be used for production, if true completely bypasses the cache

dumpContainer() protected method

Dumps the service container to PHP code in the cache.
protected dumpContainer ( Symfony\Component\Config\ConfigCache $cache )
$cache Symfony\Component\Config\ConfigCache

get() public method

Convenience method to inner container.
public get ( string $id ) : object
$id string
return object

getContainer() protected method

Returns ContainerBuilder by including the default file 'containerBuilder.php' from settings directory.
protected getContainer ( )

getInnerContainer() public method

public getInnerContainer ( ) : ContainerBuilder
return Symfony\Component\DependencyInjection\ContainerBuilder

getParameter() public method

Convenience method to inner container.
public getParameter ( string $name ) : mixed
$name string
return mixed

getRepository() public method

Public API for
public getRepository ( ) : eZ\Publish\API\Repository\Repository
return eZ\Publish\API\Repository\Repository

initializeContainer() protected method

Initializes inner container.
protected initializeContainer ( )

prepareDirectory() protected method

Checks for existence of given $directory and tries to create it if found missing.
protected prepareDirectory ( string $directory, string $name )
$directory string Path to the directory
$name string Used for exception message

Property Details

$bypassCache protected_oe property

Holds flag whether cache should be bypassed.
protected bool $bypassCache
return boolean

$cacheDir protected_oe property

Holds cache directory path.
protected string $cacheDir
return string

$containerClassName protected_oe property

Holds class name for generated container cache.
protected string $containerClassName
return string

$debug protected_oe property

Holds debug flag for cache service.
protected bool $debug
return boolean

$innerContainer protected_oe property

Holds inner Symfony container instance.
protected Container,Symfony\Component\DependencyInjection|ContainerBuilder,Symfony\Component\DependencyInjection $innerContainer
return Symfony\Component\DependencyInjection\Container | Symfony\Component\DependencyInjection\ContainerBuilder

$installDir protected_oe property

Holds installation directory path.
protected string $installDir
return string