add show_hushed option (stub) to api.system.check; CRM-13823
authorginkgoMZD <mzd@ginkgostreet.com>
Sat, 25 Apr 2015 17:23:44 +0000 (11:23 -0600)
committerJon goldberg <jon@palantetech.coop>
Tue, 21 Jul 2015 20:37:36 +0000 (16:37 -0400)
CRM/Utils/Check.php
api/v3/System.php

index e609122d5e6c59eae226925babe12f5ff5e51aab..c9789c67de84301ab09c6dac1b791610bbebe72a 100644 (file)
@@ -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', '<h2>SHOWING HUSHED [NOT]</h2>', 'Show Hushed', \Psr\Log\LogLevel::INFO);
+    }
+
     return $messages;
   }
 
index 09affcba060ef3944ef4106ac6ca4320a5116c2c..81a7a597aed9f903e5b7acce077edbac6f7770d3 100644 (file)
@@ -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)