Commit 3654988d authored by totten's avatar totten Committed by GitHub

Merge pull request #9898 from totten/master-dl-only

Extension.download API - Allow downloading without installing
parents e887e8e4 c62449ca
......@@ -244,7 +244,9 @@ function civicrm_api3_extension_download($params) {
}
CRM_Extension_System::singleton()->getCache()->flush();
CRM_Extension_System::singleton(TRUE);
CRM_Extension_System::singleton()->getManager()->install(array($params['key']));
if (CRM_Utils_Array::value('install', $params, TRUE)) {
CRM_Extension_System::singleton()->getManager()->install(array($params['key']));
}
return civicrm_api3_create_success();
}
......@@ -265,6 +267,12 @@ function _civicrm_api3_extension_download_spec(&$fields) {
'type' => CRM_Utils_Type::T_STRING,
'description' => 'Optional as the system can determine the url automatically for public extensions',
);
$fields['install'] = array(
'title' => 'Auto-install',
'type' => CRM_Utils_Type::T_STRING,
'description' => 'Automatically install the downloaded extension',
'api.default' => TRUE,
);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment