0

What are the valid parameters to pass to civicrm_api3_system_check($params)?

Passing $params = false or $params = array() causes an infinite loop despite my try catch.

../civicrm/civicrm/api/v3/System.php gives no hints

../civicrm/civicrm/api/v3/examples/System/Flush.php only shows how to use System flush

1 Answer 1

2

Your example of calling System.check with an empty $params array should work. For example, this is what I get if I call the API from the command line:

$ cv php:eval 'return civicrm_api3("System","check", array());'
{
    "is_error": 0,
    "version": 3,
    "count": 6,
    "values": {
        "1": {
            "name": "checkExtensionUpgrades",
            "message": "Extension upgrades are pending.  Please visit <a href=\"/civicrm/admin/extensions/upgrade?reset=1\">the upgrade page</a> to run them.",
            "title": "Run Extension Upgrades",
            "severity": "error",
            "severity_id": 4,
            "is_visible": 1,
            "icon": "fa-plug",
            "id": 1
        },
        ...

(For other media, you can use the API Explorer to get code snippets.)

There are a lot of checks, and it's possible that they're slow on some systems. Alternatively, maybe one of the checks has a bug, relies on an incorrect assumption about the environment or data, or has an interaction with third-party code?

3
  • So do not call it directly, but via civicrm_api3("System","check", array()). Would be nice if the examples in ../civicrm/civicrm/api/v3/examples/System/. showed the parameters to run the other System.php methods. Thank you Tim
    – Codedogs
    Mar 23, 2017 at 16:59
  • Good point, one does have to use civicrm_api3(). I take that for granted. This may be interesting: docs.civicrm.org/dev/en/master/api/usage
    – Tim Otten
    Mar 23, 2017 at 20:18
  • Another API action called HELP is needed. Then civicrm_api3("System", "HELP", array()) could display all possible actions and parameters. By the way CHECK, is not in that API action list nor anywhere else. Self documenting code, what a concept.
    – Codedogs
    Mar 24, 2017 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.