PHP Class phpbb\di\container_builder

Datei anzeigen Open project: phpbb/phpbb Class Usage Examples

Protected Properties

Property Type Description
$cache_dir string
$compile_container boolean Indicates if the container should be compiled automatically (default to true).
$config_path string Defines a custom path to find the configuration of the container (default to $this->phpbb_root_path . 'config')
$config_php_file phpbb\config_php_file
$container Symfony\Component\DependencyInjection\ContainerBuilder The container under construction
$custom_parameters array Default to: array( 'core.root_path', $this->phpbb_root_path, 'core.php_ext', $this->php_ext, );
$environment The environment to use.
$php_ext php file extension
$phpbb_root_path phpBB Root Path
$use_cache boolean If DEBUG_CONTAINER is set this option is ignored and a new container is build.
$use_extensions boolean Indicates whether extensions should be used (default to true).

Public Methods

Method Description
__construct ( string $phpbb_root_path, string $php_ext ) Constructor
get_container ( ) : phpbb_cache_container | ContainerBuilder Build and return a new Container respecting the current configuration
with_cache ( ) Enable the caching of the container.
with_cache_dir ( string $cache_dir ) Set the cache directory.
with_compiled_container ( ) Enable the compilation of the container.
with_config ( phpbb\config_php_file $config_php_file ) Set custom parameters to inject into the container.
with_config_path ( string $config_path ) Set a custom path to find the configuration of the container.
with_custom_parameters ( array $custom_parameters ) Set custom parameters to inject into the container.
with_environment ( string $environment ) Enable the extensions.
with_extensions ( ) Enable the extensions.
without_cache ( ) Disable the caching of the container.
without_compiled_container ( ) Disable the compilation of the container.
without_extensions ( ) Disable the extensions.

Protected Methods

Method Description
create_container ( array $extensions ) : ContainerBuilder Create the ContainerBuilder object
dump_container ( Symfony\Component\Config\ConfigCache $cache ) Dump the container to the disk.
get_cache_dir ( ) : string Returns the path to the cache directory (default: root_path/cache/environment).
get_config_path ( ) : string Returns the path to the container configuration (default: root_path/config)
get_container_filename ( ) : string Get the filename under which the dumped container will be stored.
get_core_parameters ( ) : array Returns the core parameters.
get_env_parameters ( ) : array Gets the environment parameters.
get_environment ( ) : string Return the name of the current environment.
inject_custom_parameters ( ) Inject the customs parameters into the container
load_extensions ( ) Load the enabled extensions.

Method Details

__construct() public method

Constructor
public __construct ( string $phpbb_root_path, string $php_ext )
$phpbb_root_path string Path to the phpbb includes directory.
$php_ext string php file extension

create_container() protected method

Create the ContainerBuilder object
protected create_container ( array $extensions ) : ContainerBuilder
$extensions array Array of Container extension objects
return Symfony\Component\DependencyInjection\ContainerBuilder object

dump_container() protected method

Dump the container to the disk.
protected dump_container ( Symfony\Component\Config\ConfigCache $cache )
$cache Symfony\Component\Config\ConfigCache The config cache

get_cache_dir() protected method

Returns the path to the cache directory (default: root_path/cache/environment).
protected get_cache_dir ( ) : string
return string Path to the cache directory.

get_config_path() protected method

Returns the path to the container configuration (default: root_path/config)
protected get_config_path ( ) : string
return string

get_container() public method

Build and return a new Container respecting the current configuration
public get_container ( ) : phpbb_cache_container | ContainerBuilder
return phpbb_cache_container | Symfony\Component\DependencyInjection\ContainerBuilder

get_container_filename() protected method

Get the filename under which the dumped container will be stored.
protected get_container_filename ( ) : string
return string Path for dumped container

get_core_parameters() protected method

Returns the core parameters.
protected get_core_parameters ( ) : array
return array An array of core parameters

get_env_parameters() protected method

Only the parameters starting with "PHPBB__" are considered.
protected get_env_parameters ( ) : array
return array An array of parameters

get_environment() protected method

Return the name of the current environment.
protected get_environment ( ) : string
return string

inject_custom_parameters() protected method

Inject the customs parameters into the container
protected inject_custom_parameters ( )

load_extensions() protected method

Load the enabled extensions.
protected load_extensions ( )

with_cache() public method

If DEBUG_CONTAINER is set this option is ignored and a new container is build.
public with_cache ( )

with_cache_dir() public method

Set the cache directory.
public with_cache_dir ( string $cache_dir )
$cache_dir string The cache directory.

with_compiled_container() public method

Enable the compilation of the container.

with_config() public method

Set custom parameters to inject into the container.
public with_config ( phpbb\config_php_file $config_php_file )
$config_php_file phpbb\config_php_file

with_config_path() public method

Set a custom path to find the configuration of the container.
public with_config_path ( string $config_path )
$config_path string

with_custom_parameters() public method

Set custom parameters to inject into the container.
public with_custom_parameters ( array $custom_parameters )
$custom_parameters array

with_environment() public method

Enable the extensions.
public with_environment ( string $environment )
$environment string The environment to use

with_extensions() public method

Enable the extensions.
public with_extensions ( )

without_cache() public method

Disable the caching of the container.
public without_cache ( )

without_compiled_container() public method

Disable the compilation of the container.

without_extensions() public method

Disable the extensions.
public without_extensions ( )

Property Details

$cache_dir protected_oe property

protected string $cache_dir
return string

$compile_container protected_oe property

Indicates if the container should be compiled automatically (default to true).
protected bool $compile_container
return boolean

$config_path protected_oe property

Defines a custom path to find the configuration of the container (default to $this->phpbb_root_path . 'config')
protected string $config_path
return string

$config_php_file protected_oe property

protected config_php_file,phpbb $config_php_file
return phpbb\config_php_file

$container protected_oe property

The container under construction
protected ContainerBuilder,Symfony\Component\DependencyInjection $container
return Symfony\Component\DependencyInjection\ContainerBuilder

$custom_parameters protected_oe property

Default to: array( 'core.root_path', $this->phpbb_root_path, 'core.php_ext', $this->php_ext, );
protected array $custom_parameters
return array

$environment protected_oe property

The environment to use.
protected $environment

$php_ext protected_oe property

php file extension
protected $php_ext

$phpbb_root_path protected_oe property

phpBB Root Path
protected $phpbb_root_path

$use_cache protected_oe property

If DEBUG_CONTAINER is set this option is ignored and a new container is build.
protected bool $use_cache
return boolean

$use_extensions protected_oe property

Indicates whether extensions should be used (default to true).
protected bool $use_extensions
return boolean