X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FSystem.php;h=5da438e636e34473cde4a93c72f476e5102292b7;hb=a6c01b45f0cdaee8677de72b8bf3e784d8b6b62a;hp=79c66f264578aa539992a62d01dbf1bbe2e35cda;hpb=192e8d1a947814993aa699e47ac1669ac17b1045;p=civicrm-core.git diff --git a/api/v3/System.php b/api/v3/System.php index 79c66f2645..5da438e636 100644 --- a/api/v3/System.php +++ b/api/v3/System.php @@ -2,7 +2,7 @@ /* +--------------------------------------------------------------------+ - | CiviCRM version 4.5 | + | CiviCRM version 4.6 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ @@ -40,11 +40,13 @@ /** * Flush all system caches * - * @param array $params input parameters + * @param array $params + * Input parameters. * - triggers: bool, whether to drop/create SQL triggers; default: FALSE * - session: bool, whether to reset the CiviCRM session data; defaul: FALSE * - * @return boolean true if success, else false + * @return boolean + * true if success, else false * @static void * @access public * @example SystemFlush.php @@ -62,9 +64,10 @@ function civicrm_api3_system_flush($params) { * Adjust Metadata for Flush action * * The metadata is used for setting defaults, documentation & validation - * @param array $params array or parameters determined by getfields + * @param array $params + * Array or parameters determined by getfields. */ -function _civicrm_api3_system_flush_spec(&$params){ +function _civicrm_api3_system_flush_spec(&$params) { $params['triggers'] = array('title' => 'rebuild triggers (boolean)'); $params['session'] = array('title' => 'refresh sessions (boolean)'); } @@ -73,7 +76,8 @@ function _civicrm_api3_system_flush_spec(&$params){ * System.Check API specification (optional) * This is used for documentation and validation. * - * @param array $spec description of fields supported by this API call + * @param array $spec + * Description of fields supported by this API call. * @return void * @see http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards */ @@ -85,7 +89,8 @@ function _civicrm_api3_system_check_spec(&$spec) { * System.Check API * * @param array $params - * @return array API result descriptor; return items are alert codes/messages + * @return array + * API result descriptor; return items are alert codes/messages * @see civicrm_api3_create_success * @see civicrm_api3_create_error * @throws API_Exception @@ -101,7 +106,7 @@ function civicrm_api3_system_check($params) { } /** - * @param $params + * @param array $params * * @return array */ @@ -109,12 +114,12 @@ function civicrm_api3_system_log($params) { $log = new CRM_Utils_SystemLogger(); // this part means fields with separate db storage are accepted as params which kind of seems more intuitive to me // because I felt like not doing this required a bunch of explanation in the spec function - but perhaps other won't see it as helpful? - if(!isset($params['context'])) { + if (!isset($params['context'])) { $params['context'] = array(); } $specialFields = array('contact_id', 'hostname'); - foreach($specialFields as $specialField) { - if(isset($params[$specialField]) && !isset($params['context'])) { + foreach ($specialFields as $specialField) { + if (isset($params[$specialField]) && !isset($params['context'])) { $params['context'][$specialField] = $params[$specialField]; } } @@ -124,7 +129,7 @@ function civicrm_api3_system_log($params) { /** * Metadata for log function - * @param $params + * @param array $params */ function _civicrm_api3_system_log_spec(&$params) { $params['level'] = array( @@ -156,3 +161,18 @@ function _civicrm_api3_system_log_spec(&$params) { 'type' => CRM_Utils_Type::T_STRING, ); } + +/** + * System.Get API + * + * @param arary $params + */ +function civicrm_api3_system_get($params) { + $returnValues = array( + array( + 'version' => CRM_Utils_System::version(), + 'uf' => CIVICRM_UF, + ), + ); + return civicrm_api3_create_success($returnValues, $params, 'System', 'get'); +}