You are here

function fastly_get_api in Fastly 7

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

Returns the API object.

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

9 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_rules_action_purge in ./fastly.rules.inc
Rules action to purge the URL after the content is updated.

... See full list

File

./fastly.module, line 148
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);
}