Container
in package
Class Container
Table of Contents
Constants
- SELF = 'civi_container_factory'
Methods
- boot() : mixed
- Get a list of boot services.
- createAngularManager() : Manager
- createApiKernel() : Kernel
- createCacheConfig() : ArrayObject
- createContainer() : ContainerBuilder
- Construct a new container.
- createEsmLoader() : object
- Determine which component will load ECMAScript Modules.
- createEventDispatcher() : CiviEventDispatcherInterface
- createLockManager() : LockManager
- createPrevNextCache() : CRM_Core_PrevNextCache_Interface
- createResources() : CRM_Core_Resources
- getBootService() : mixed
- isContainerBooted() : bool
- Determine whether the container services are available.
- loadContainer() : ContainerInterface
- Find a cached container definition or construct a new one.
- singleton() : TaggedContainerInterface
Constants
SELF
public
mixed
SELF
= 'civi_container_factory'
Methods
boot()
Get a list of boot services.
public
static boot(bool $loadFromDB) : mixed
These are services which must be setup before the container can operate.
Parameters
- $loadFromDB : bool
Tags
createAngularManager()
public
createAngularManager() : Manager
Return values
ManagercreateApiKernel()
public
createApiKernel(CiviEventDispatcherInterface $dispatcher, mixed $magicFunctionProvider) : Kernel
Parameters
- $dispatcher : CiviEventDispatcherInterface
- $magicFunctionProvider : mixed
Return values
KernelcreateCacheConfig()
public
static createCacheConfig() : ArrayObject
Return values
ArrayObjectcreateContainer()
Construct a new container.
public
createContainer() : ContainerBuilder
Return values
ContainerBuildercreateEsmLoader()
Determine which component will load ECMAScript Modules.
public
static createEsmLoader(ContainerInterface $container) : object
Parameters
- $container : ContainerInterface
Return values
objectcreateEventDispatcher()
public
createEventDispatcher() : CiviEventDispatcherInterface
Return values
CiviEventDispatcherInterfacecreateLockManager()
public
static createLockManager() : LockManager
Return values
LockManagercreatePrevNextCache()
public
static createPrevNextCache(ContainerInterface $container) : CRM_Core_PrevNextCache_Interface
Parameters
- $container : ContainerInterface
Return values
CRM_Core_PrevNextCache_InterfacecreateResources()
public
static createResources(ContainerInterface $container) : CRM_Core_Resources
Parameters
- $container : ContainerInterface
Return values
CRM_Core_ResourcesgetBootService()
public
static getBootService(string $name) : mixed
Parameters
- $name : string
isContainerBooted()
Determine whether the container services are available.
public
static isContainerBooted() : bool
Return values
boolloadContainer()
Find a cached container definition or construct a new one.
public
loadContainer() : ContainerInterface
There are many weird contexts in which Civi initializes (eg different variations of multitenancy and different permutations of CMS/CRM bootstrap), and hook_container may fire a bit differently in each context. To mitigate risk of leaks between environments, we compute a unique envID (md5(DB_NAME, HTTP_HOST, SCRIPT_FILENAME, etc)) and use separate caches for each (eg "templates_c/CachedCiviContainer.$ENVID.php").
Constants:
- CIVICRM_CONTAINER_CACHE -- 'always' [default], 'never', 'auto'
- CIVICRM_DSN
- CIVICRM_DOMAIN_ID
Return values
ContainerInterfacesingleton()
public
static singleton([bool $reset = FALSE ]) : TaggedContainerInterface
Parameters
- $reset : bool = FALSE
-
Whether to forcibly rebuild the entire container.