From a1c17079be03de579da6d694d0a794447bc299ca Mon Sep 17 00:00:00 2001 From: ginkgoMZD Date: Sat, 25 Apr 2015 11:23:44 -0600 Subject: [PATCH] add show_hushed option (stub) to api.system.check; CRM-13823 --- CRM/Utils/Check.php | 7 ++++++- api/v3/System.php | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/Check.php b/CRM/Utils/Check.php index e609122d5e..c9789c67de 100644 --- a/CRM/Utils/Check.php +++ b/CRM/Utils/Check.php @@ -153,7 +153,7 @@ class CRM_Utils_Check { * Array of messages * @link https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_requirements */ - public function checkAll() { + public function checkAll($showHushed = false) { $checks = array(); $checks[] = new CRM_Utils_Check_Security(); $checks[] = new CRM_Utils_Check_Env(); @@ -176,6 +176,11 @@ class CRM_Utils_Check { CRM_Utils_Hook::check($messages); + //TODO + if ($showHushed) { + $messages[] = new CRM_Utils_Check_Message('ShowHushed', '

SHOWING HUSHED [NOT]

', 'Show Hushed', \Psr\Log\LogLevel::INFO); + } + return $messages; } diff --git a/api/v3/System.php b/api/v3/System.php index 09affcba06..81a7a597ae 100644 --- a/api/v3/System.php +++ b/api/v3/System.php @@ -84,6 +84,11 @@ function _civicrm_api3_system_flush_spec(&$params) { */ function _civicrm_api3_system_check_spec(&$spec) { // $spec['magicword']['api.required'] = 1; + $spec['show_hushed'] = array( + 'api.default' => false, + 'title' => 'show hushed', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); } /** @@ -99,8 +104,9 @@ function _civicrm_api3_system_check_spec(&$spec) { */ function civicrm_api3_system_check($params) { $returnValues = array(); - foreach (CRM_Utils_Check::singleton()->checkAll() as $message) { - $returnValues[] = $message->toArray(); + $messages = CRM_Utils_Check::singleton()->checkAll(CRM_Utils_Array::value('show_hushed', $params)); + foreach ( $messages as $msg) { + $returnValues[] = $msg->toArray(); } // Spec: civicrm_api3_create_success($values = 1, $params = array(), $entity = NULL, $action = NULL) -- 2.25.1