本文整理汇总了PHP中CRM_Utils_Hook::check方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Hook::check方法的具体用法?PHP CRM_Utils_Hook::check怎么用?PHP CRM_Utils_Hook::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_Hook
的用法示例。
在下文中一共展示了CRM_Utils_Hook::check方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAll
/**
* Run all system checks.
*
* This functon is wrapped by the System.check api.
*
* Calls hook_civicrm_check() for extensions to add or modify messages.
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_check
*
* @param bool $max
* Whether to return just the maximum non-hushed severity
*
* @return array
* Array of CRM_Utils_Check_Message objects
*/
public static function checkAll($max = FALSE)
{
$messages = array();
foreach (glob(__DIR__ . '/Check/Component/*.php') as $filePath) {
$className = 'CRM_Utils_Check_Component_' . basename($filePath, '.php');
/* @var CRM_Utils_Check_Component $check */
$check = new $className();
if ($check->isEnabled()) {
$messages = array_merge($messages, $check->checkAll());
}
}
CRM_Utils_Hook::check($messages);
uasort($messages, array(__CLASS__, 'severitySort'));
$maxSeverity = 1;
foreach ($messages as $message) {
if (!$message->isVisible()) {
continue;
}
$maxSeverity = max(1, $message->getLevel());
break;
}
Civi::settings()->set('systemStatusCheckResult', $maxSeverity);
return $max ? $maxSeverity : $messages;
}
示例2: checkAll
/**
* Run some sanity checks.
*
* This could become a hook so that CiviCRM can run both built-in
* configuration & sanity checks, and modules/extensions can add
* their own checks.
*
* We might even expose the results of these checks on the Wordpress
* plugin status page or the Drupal admin/reports/status path.
*
* @return array
* Array of messages
* @link https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_requirements
*/
public function checkAll()
{
$checks = array();
$checks[] = new CRM_Utils_Check_Security();
$checks[] = new CRM_Utils_Check_Env();
$compInfo = CRM_Core_Component::getEnabledComponents();
foreach ($compInfo as $compObj) {
switch ($compObj->info['name']) {
case 'CiviCase':
$checks[] = new CRM_Utils_Check_Case(CRM_Case_XMLRepository::singleton(), CRM_Case_PseudoConstant::caseType('name'));
break;
default:
}
}
$messages = array();
foreach ($checks as $check) {
$messages = array_merge($messages, $check->checkAll());
}
CRM_Utils_Hook::check($messages);
return $messages;
}
示例3: checkAll
/**
* Run all system checks.
*
* This functon is wrapped by the System.check api.
*
* Calls hook_civicrm_check() for extensions to add or modify messages.
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_check
*
* @param bool $max
* Whether to return just the maximum non-hushed severity
*
* @return array
* Array of CRM_Utils_Check_Message objects
*/
public static function checkAll($max = FALSE)
{
$checks = array();
$checks[] = new CRM_Utils_Check_Security();
$checks[] = new CRM_Utils_Check_Env();
$compInfo = CRM_Core_Component::getEnabledComponents();
foreach ($compInfo as $compObj) {
switch ($compObj->info['name']) {
case 'CiviCase':
$checks[] = new CRM_Utils_Check_Case(CRM_Case_XMLRepository::singleton(), CRM_Case_PseudoConstant::caseType('name'));
break;
default:
}
}
$messages = array();
foreach ($checks as $check) {
$messages = array_merge($messages, $check->checkAll());
}
CRM_Utils_Hook::check($messages);
uasort($messages, array(__CLASS__, 'severitySort'));
$maxSeverity = 1;
foreach ($messages as $message) {
if (!$message->isVisible()) {
continue;
}
$maxSeverity = max(1, $message->getLevel());
break;
}
Civi::settings()->set('systemStatusCheckResult', $maxSeverity);
return $max ? $maxSeverity : $messages;
}
示例4: checkAll
/**
* Run some sanity checks.
*
* This could become a hook so that CiviCRM can run both built-in
* configuration & sanity checks, and modules/extensions can add
* their own checks.
*
* We might even expose the results of these checks on the Wordpress
* plugin status page or the Drupal admin/reports/status path.
*
* @return array
* Array of messages
* @link https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_requirements
*/
public function checkAll($showHushed = FALSE)
{
$checks = array();
$checks[] = new CRM_Utils_Check_Security();
$checks[] = new CRM_Utils_Check_Env();
$compInfo = CRM_Core_Component::getEnabledComponents();
foreach ($compInfo as $compObj) {
switch ($compObj->info['name']) {
case 'CiviCase':
$checks[] = new CRM_Utils_Check_Case(CRM_Case_XMLRepository::singleton(), CRM_Case_PseudoConstant::caseType('name'));
break;
default:
}
}
$messages = array();
foreach ($checks as $check) {
$messages = array_merge($messages, $check->checkAll());
}
CRM_Utils_Hook::check($messages);
if (!$showHushed) {
foreach ($messages as $key => $message) {
$hush = self::checkHushSnooze($message);
if ($hush) {
unset($messages[$key]);
}
}
}
uasort($messages, array(__CLASS__, 'severitySort'));
return $messages;
}