PHP Class FOF30\Container\Container

The properties below (except componentName, bareComponentName and the ones marked with property-read) can be configured in the fof.xml component configuration file. Sample fof.xml: The paths can use the variables %ROOT%, %PUBLIC%, %ADMIN%, %TMP%, %LOG% i.e. all the path keys returned by Platform's getPlatformBaseDirs() method in uppercase and surrounded by percent signs.
Inheritance: extends ContainerBase
Afficher le fichier Open project: akeeba/fof Class Usage Examples

Protected Properties

Свойство Type Description
$instances array Cache of created container instances

Méthodes publiques

Méthode Description
__construct ( array $values = [] ) Public constructor. This does NOT go through the fof.xml file. You are advised to use getInstance() instead.
getInstance ( string $component, array $values = [], string $section = 'auto' ) : Container Returns a container instance for a specific component. This method goes through fof.xml to read the default configuration values for the container. You are advised to use this unless you have a specific reason for instantiating a Container without going through the fof.xml file.
getNamespacePrefix ( string $section = 'auto' ) : string Get the applicable namespace prefix for a component section. Possible sections: auto Auto-detect which is the current component section inverse The inverse area than auto site Frontend admin Backend
parsePathVariables ( $path )

Méthodes protégées

Méthode Description
getDefaultMediaVersion ( ) : string Gets the default media version string for the component using the component's version and date, as well as the site's secret key.
makeInstance ( string $component, array $values = [], string $section = 'auto' ) : Container Returns a temporary container instance for a specific component.

Method Details

__construct() public méthode

Public constructor. This does NOT go through the fof.xml file. You are advised to use getInstance() instead.
public __construct ( array $values = [] )
$values array Overrides for the container configuration and services

getDefaultMediaVersion() protected méthode

Gets the default media version string for the component using the component's version and date, as well as the site's secret key.
protected getDefaultMediaVersion ( ) : string
Résultat string

getInstance() public static méthode

Pass the value 'tempInstance' => true in the $values array to get a temporary instance. Otherwise you will get the cached instance of the previously created container.
public static getInstance ( string $component, array $values = [], string $section = 'auto' ) : Container
$component string The component you want to get a container for, e.g. com_foobar.
$values array Container configuration overrides you want to apply. Optional.
$section string The application section (site, admin) you want to fetch. Any other value results in auto-detection.
Résultat Container

getNamespacePrefix() public méthode

Get the applicable namespace prefix for a component section. Possible sections: auto Auto-detect which is the current component section inverse The inverse area than auto site Frontend admin Backend
public getNamespacePrefix ( string $section = 'auto' ) : string
$section string The section you want to get information for
Résultat string The namespace prefix for the component's classes, e.g. \Foobar\Example\Site\

makeInstance() protected static méthode

Returns a temporary container instance for a specific component.
protected static makeInstance ( string $component, array $values = [], string $section = 'auto' ) : Container
$component string The component you want to get a container for, e.g. com_foobar.
$values array Container configuration overrides you want to apply. Optional.
$section string The application section (site, admin) you want to fetch. Any other value results in auto-detection.
Résultat Container

parsePathVariables() public méthode

public parsePathVariables ( $path )

Property Details

$instances protected_oe static_oe property

Cache of created container instances
protected static array $instances
Résultat array