ServiceProvider extends AbstractServiceProvider
Table of Contents
Methods
- addEventListeners() : ListenerProvider
- configureBackendModules() : ArrayObject
- configureBackendRouter() : Router
- configureBackendRoutes() : ArrayObject
- configureContentSecurityPolicies() : Map<Scope, Map<MutationOrigin, MutationCollection>>
- configureGlobalPageTsConfig() : ArrayObject
- configureIcons() : ArrayObject
- configureMiddlewares() : ArrayObject
- getApplication() : Application
- getBackendMiddlewares() : ArrayObject
- getBackendModules() : ArrayObject
- getBackendModulesWarmer() : Closure
- getBackendRoutes() : ArrayObject
- getBackendRoutesWarmer() : Closure
- getExtensions() : array<string|int, callable>
- Returns a list of all container entries extended by this service provider.
- getFactories() : array<string|int, callable>
- Returns a list of all container entries registered by this service provider.
- getModuleFactory() : ModuleFactory
- getModuleProvider() : ModuleProvider
- getModuleRegistry() : ModuleRegistry
- getRequestHandler() : RequestHandler
- getRouteDispatcher() : RouteDispatcher
- getUriBuilder() : UriBuilder
- getPackageName() : string
- Return the composer package name. This is the 'name' attribute in composer.json.
- getPackagePath() : string
- Return the path to the package location, including trailing slash should return the value of: __DIR__ . '/../' for ServiceProviders located in the Classes/ directory
- new() : mixed
- Create an instance of a class. Supports auto injection of the logger.
- requireFile() : mixed
- Require a file in a safe scoped environment avoiding local variable clashes.
Methods
addEventListeners()
public
static addEventListeners(ContainerInterface $container, ListenerProvider $listenerProvider) : ListenerProvider
Parameters
- $container : ContainerInterface
- $listenerProvider : ListenerProvider
Return values
ListenerProviderconfigureBackendModules()
public
static configureBackendModules(ContainerInterface $container, ArrayObject $modules[, string|null $path = null ][, string|null $packageName = null ]) : ArrayObject
Parameters
- $container : ContainerInterface
- $modules : ArrayObject
- $path : string|null = null
-
supplied when invoked internally through PseudoServiceProvider
- $packageName : string|null = null
-
supplied when invoked internally through PseudoServiceProvider
Return values
ArrayObjectconfigureBackendRouter()
public
static configureBackendRouter(ContainerInterface $container[, Router|null $router = null ]) : Router
Parameters
- $container : ContainerInterface
- $router : Router|null = null
Return values
RouterconfigureBackendRoutes()
public
static configureBackendRoutes(ContainerInterface $container, ArrayObject $routes[, string|null $path = null ][, string|null $packageName = null ]) : ArrayObject
Parameters
- $container : ContainerInterface
- $routes : ArrayObject
- $path : string|null = null
-
supplied when invoked internally through PseudoServiceProvider
- $packageName : string|null = null
-
supplied when invoked internally through PseudoServiceProvider
Return values
ArrayObjectconfigureContentSecurityPolicies()
public
static configureContentSecurityPolicies(ContainerInterface $container, Map<Scope, Map<MutationOrigin, MutationCollection>> $mutations[, string|null $path = null ][, string|null $packageName = null ]) : Map<Scope, Map<MutationOrigin, MutationCollection>>
Parameters
- $container : ContainerInterface
- $mutations : Map<Scope, Map<MutationOrigin, MutationCollection>>
- $path : string|null = null
- $packageName : string|null = null
Return values
Map<Scope, Map<MutationOrigin, MutationCollection>>configureGlobalPageTsConfig()
public
static configureGlobalPageTsConfig(ContainerInterface $container, ArrayObject $tsConfigFiles[, string|null $path = null ]) : ArrayObject
since v12, will be removed with v13 together with class PageTsConfigLoader.
Parameters
- $container : ContainerInterface
- $tsConfigFiles : ArrayObject
- $path : string|null = null
Return values
ArrayObjectconfigureIcons()
public
static configureIcons(ContainerInterface $container, ArrayObject $icons[, string|null $path = null ]) : ArrayObject
Parameters
- $container : ContainerInterface
- $icons : ArrayObject
- $path : string|null = null
Return values
ArrayObjectconfigureMiddlewares()
public
static configureMiddlewares(ContainerInterface $container, ArrayObject $middlewares[, string|null $path = null ]) : ArrayObject
Parameters
- $container : ContainerInterface
- $middlewares : ArrayObject
- $path : string|null = null
-
supplied when invoked internally through PseudoServiceProvider
Return values
ArrayObjectgetApplication()
public
static getApplication(ContainerInterface $container) : Application
Parameters
- $container : ContainerInterface
Return values
ApplicationgetBackendMiddlewares()
public
static getBackendMiddlewares(ContainerInterface $container) : ArrayObject
Parameters
- $container : ContainerInterface
Tags
Return values
ArrayObjectgetBackendModules()
public
static getBackendModules(ContainerInterface $container) : ArrayObject
Parameters
- $container : ContainerInterface
Return values
ArrayObjectgetBackendModulesWarmer()
public
static getBackendModulesWarmer(ContainerInterface $container) : Closure
Parameters
- $container : ContainerInterface
Return values
ClosuregetBackendRoutes()
public
static getBackendRoutes(ContainerInterface $container) : ArrayObject
Parameters
- $container : ContainerInterface
Return values
ArrayObjectgetBackendRoutesWarmer()
public
static getBackendRoutesWarmer(ContainerInterface $container) : Closure
Parameters
- $container : ContainerInterface
Return values
ClosuregetExtensions()
Returns a list of all container entries extended by this service provider.
public
getExtensions() : array<string|int, callable>
- the key is the entry name
- the value is a callable that will return the modified entry
Callables have the following signature: function(Psr\Container\ContainerInterface $container, $previous) or function(Psr\Container\ContainerInterface $container, $previous = null)
About factories parameters:
- the container (instance of
Psr\Container\ContainerInterface
) - the entry to be extended. If the entry to be extended does not exist and the parameter is nullable,
null
will be passed.
Return values
array<string|int, callable>getFactories()
Returns a list of all container entries registered by this service provider.
public
getFactories() : array<string|int, callable>
- the key is the entry name
- the value is a callable that will return the entry, aka the factory
Factories have the following signature: function(\Psr\Container\ContainerInterface $container)
Return values
array<string|int, callable>getModuleFactory()
public
static getModuleFactory(ContainerInterface $container) : ModuleFactory
Parameters
- $container : ContainerInterface
Return values
ModuleFactorygetModuleProvider()
public
static getModuleProvider(ContainerInterface $container) : ModuleProvider
Parameters
- $container : ContainerInterface
Return values
ModuleProvidergetModuleRegistry()
public
static getModuleRegistry(ContainerInterface $container) : ModuleRegistry
Parameters
- $container : ContainerInterface
Return values
ModuleRegistrygetRequestHandler()
public
static getRequestHandler(ContainerInterface $container) : RequestHandler
Parameters
- $container : ContainerInterface
Return values
RequestHandlergetRouteDispatcher()
public
static getRouteDispatcher(ContainerInterface $container) : RouteDispatcher
Parameters
- $container : ContainerInterface
Return values
RouteDispatchergetUriBuilder()
public
static getUriBuilder(ContainerInterface $container) : UriBuilder
Parameters
- $container : ContainerInterface
Return values
UriBuildergetPackageName()
Return the composer package name. This is the 'name' attribute in composer.json.
protected
static getPackageName() : string
Note composer.json existence for 'extensions' is still not mandatory in non-composer mode, the method returns empty string in this case.
Return values
stringgetPackagePath()
Return the path to the package location, including trailing slash should return the value of: __DIR__ . '/../' for ServiceProviders located in the Classes/ directory
protected
static getPackagePath() : string
Return values
stringnew()
Create an instance of a class. Supports auto injection of the logger.
protected
static new(ContainerInterface $container, string $className[, array<string|int, mixed> $constructorArguments = [] ]) : mixed
Parameters
- $container : ContainerInterface
- $className : string
-
name of the class to instantiate, must not be empty and not start with a backslash
- $constructorArguments : array<string|int, mixed> = []
-
Arguments for the constructor
requireFile()
Require a file in a safe scoped environment avoiding local variable clashes.
protected
static requireFile(string $filename) : mixed
Parameters
- $filename : string