Civi
class Civi
Class Civi
The "Civi" class provides a facade for accessing major subsystems, such as the service-container and settings manager. It serves as a bridge which allows procedural code to access important objects.
General principles: - Each function provides access to a major subsystem. - Each function performs a simple lookup. - Each function returns an interface. - Whenever possible, interfaces should be well-known (e.g. based on a standard or well-regarded provider).
Properties
static | $statics | A central location for static variable storage. |
Methods
EXPERIMENTAL. Retrieve a named cache instance.
Get the service container.
Get the event dispatcher.
No description
No description
Fetch a service from the container.
Reset all ephemeral system state, e.g. statics, singletons, containers.
No description
Obtain the domain settings.
Details
at line 44
static CRM_Utils_Cache_Interface
cache(string $name = 'default')
EXPERIMENTAL. Retrieve a named cache instance.
This interface is flagged as experimental due to political ambiguity in PHP community -- PHP-FIG has an open but somewhat controversial draft standard for caching. Based on the current draft, it's expected that this function could simultaneously support both CRM_Utils_Cache_Interface and PSR-6, but that depends on whether PSR-6 changes any more.
at line 53
static ContainerInterface
container()
Get the service container.
at line 62
static EventDispatcherInterface
dispatcher()
Get the event dispatcher.
at line 69
static LockManager
lockManager()
at line 76
static LoggerInterface
log()
at line 85
static Paths
paths()
Obtain the core file/path mapper.
at line 96
static mixed
service(string $id)
Fetch a service from the container.
at line 104
static
reset()
Reset all ephemeral system state, e.g. statics, singletons, containers.
at line 112
static CRM_Core_Resources
resources()
at line 123
static SettingsBag
settings(int|null $domainID = NULL)
Obtain the domain settings.