2 namespace PayPal\Common;
6 * Returns the value of the User-Agent header
7 * Add environment values and php version numbers
8 * @param string $sdkName
9 * @param string $sdkVersion
11 public static function getValue($sdkName, $sdkVersion) {
16 'bit=' . self::_getPHPBit(),
17 'os=' . str_replace(' ' , '_', php_uname('s') . ' ' . php_uname('r')),
18 'machine=' . php_uname('m')
20 if(defined('OPENSSL_VERSION_TEXT')) {
21 $opensslVersion = explode(' ', OPENSSL_VERSION_TEXT);
22 $featureList[] = 'openssl='. $opensslVersion[1];
24 if(function_exists('curl_version')) {
25 $curlVersion = curl_version();
26 $featureList[] = 'curl=' . $curlVersion['version'];
28 return sprintf("PayPalSDK/%s %s (%s)", $sdkName, $sdkVersion, implode(';', $featureList));
31 private static function _getPHPBit() {
32 switch(PHP_INT_SIZE) {