CRM_Utils_Check
in package
Tags
Table of Contents
Constants
- CHECK_TIMER = 86400
Properties
- $severityList : array<string|int, mixed>
- $_singleton : object
- We only need one instance of this object, so we use the singleton pattern and cache the instance in this variable
Methods
- assertValid() : mixed
- Throw an exception if any of the checks fail.
- checkAll() : array<string|int, CRM_Utils_Check_Message>
- Run all enabled system checks.
- checkStatus() : array<string|int, CRM_Utils_Check_Message>
- getSeverityList() : array<string|int, mixed>
- getSeverityOptions() : array<string|int, array<string|int, mixed>>
- severityMap() : string|int
- Get the integer value (useful for thresholds) of the severity.
- showPeriodicAlerts() : mixed
- Display daily system status alerts (admin only).
- singleton() : CRM_Utils_Check
- Provide static instance of CRM_Utils_Check.
- toStatusLabel() : string
Constants
CHECK_TIMER
public
mixed
CHECK_TIMER
= 86400
Properties
$severityList
protected
static array<string|int, mixed>
$severityList
= [\Psr\Log\LogLevel::DEBUG, \Psr\Log\LogLevel::INFO, \Psr\Log\LogLevel::NOTICE, \Psr\Log\LogLevel::WARNING, \Psr\Log\LogLevel::ERROR, \Psr\Log\LogLevel::CRITICAL, \Psr\Log\LogLevel::ALERT, \Psr\Log\LogLevel::EMERGENCY]
Tags
$_singleton
We only need one instance of this object, so we use the singleton pattern and cache the instance in this variable
private
static object
$_singleton
= \NULL
Methods
assertValid()
Throw an exception if any of the checks fail.
public
assertValid([array<string|int, mixed>|null $messages = NULL ][, string $threshold = PsrLogLogLevel::ERROR ]) : mixed
Parameters
- $messages : array<string|int, mixed>|null = NULL
-
[CRM_Utils_Check_Message]
- $threshold : string = PsrLogLogLevel::ERROR
Tags
checkAll()
Run all enabled system checks.
public
static checkAll([bool $max = FALSE ]) : array<string|int, CRM_Utils_Check_Message>
This functon is wrapped by the System.check api.
Calls hook_civicrm_check() for extensions to add or modify messages.
Parameters
- $max : bool = FALSE
-
Whether to return just the maximum non-hushed severity
Tags
Return values
array<string|int, CRM_Utils_Check_Message>checkStatus()
public
static checkStatus([array<string|int, mixed> $statusNames = [] ][, bool $includeDisabled = FALSE ]) : array<string|int, CRM_Utils_Check_Message>
Parameters
- $statusNames : array<string|int, mixed> = []
-
Optionally specify the names of specific checks to run, or leave empty to run all
- $includeDisabled : bool = FALSE
-
Run checks that have been explicitly disabled (default false)
Return values
array<string|int, CRM_Utils_Check_Message>getSeverityList()
public
static getSeverityList() : array<string|int, mixed>
Return values
array<string|int, mixed>getSeverityOptions()
public
static getSeverityOptions() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>severityMap()
Get the integer value (useful for thresholds) of the severity.
public
static severityMap(int|string $severity[, bool $reverse = FALSE ]) : string|int
Parameters
- $severity : int|string
-
the value to look up
- $reverse : bool = FALSE
-
whether to find the constant from the integer
Tags
Return values
string|intshowPeriodicAlerts()
Display daily system status alerts (admin only).
public
showPeriodicAlerts() : mixed
singleton()
Provide static instance of CRM_Utils_Check.
public
static & singleton() : CRM_Utils_Check
Return values
CRM_Utils_ChecktoStatusLabel()
public
static toStatusLabel(int $level) : string
Parameters
- $level : int