You are here

function fastly_get_api in Fastly 7.2

Same name and namespace in other branches
  1. 7 fastly.module \fastly_get_api()

Returns the API object.

The key and service id can be overriden for validation reasons.

8 calls to fastly_get_api()
fastly_expire_cache in ./fastly.module
Implements hook_expire_cache().
fastly_new_service_form_submit in ./fastly.admin.inc
Implements hook_form_submit().
fastly_purge_form_submit in ./fastly.admin.inc
Implements hook_form_submit().
fastly_register_form_submit in ./fastly.admin.inc
Implements hook_form_submit().
fastly_setup_form in ./fastly.admin.inc
Settings form.

... See full list

File

./fastly.module, line 176
Fastly module.

Code

function fastly_get_api($api_key = '', $service_id = '') {
  if (empty($api_key)) {
    $api_key = variable_get('fastly_api_key', '');
  }
  if (empty($service_id)) {
    $service_id = variable_get('fastly_service_id', '');
  }
  return new Fastly($api_key, $service_id);
}