AcquiaDAM_API.inc in Media: Acquia DAM 7
File
src/AcquiaDAM/AcquiaDAM_API.inc
View source
<?php
class AcquiaDAM_API {
public static function getClient($key = NULL) {
$client_mode = variable_get('media_acquiadam_client_mode', 'mixed');
if (empty($key) && 'mixed' == $client_mode) {
$key = 'acquiadam-server-auth';
}
elseif (empty($key) && 'background' == $client_mode) {
$key = 'acquiadam-user-auth';
}
static $client;
if (empty($client[$key])) {
try {
$oauth2_client = oauth2_client_load($key);
$client[$key] = new AcquiaDAM_Client($oauth2_client);
} catch (Exception $x) {
watchdog_exception('AcquiaDAM_API', $x);
}
}
return $client[$key];
}
}