function _mailchimp_get_user_agent in Mailchimp 8
Same name and namespace in other branches
- 7.5 mailchimp.module \_mailchimp_get_user_agent()
- 7.4 mailchimp.module \_mailchimp_get_user_agent()
- 2.x mailchimp.module \_mailchimp_get_user_agent()
Gets the user agent string for this installation of Mailchimp.
Return value
string The user agent string.
1 call to _mailchimp_get_user_agent()
- mailchimp_get_api_object in ./
mailchimp.module - Instantiates a Mailchimp library object.
File
- ./
mailchimp.module, line 99 - Mailchimp module.
Code
function _mailchimp_get_user_agent() {
$version = '8.x-1.x';
if (\Drupal::moduleHandler()
->moduleExists('system')) {
/** @var \Drupal\Core\Extension\ModuleExtensionList $extension_list */
$extension_list = \Drupal::service('extension.list.module');
$info = $extension_list
->getExtensionInfo('mailchimp');
if (!empty($info['version'])) {
$version = $info['version'];
}
}
$user_agent = "DrupalMailchimp/{$version} " . \GuzzleHttp\default_user_agent();
return $user_agent;
}