Gets the client's user agent for API calls

@return string
2746
private function getUserAgent()
    {
        $curlinfo = curl_version();
        $uagent = array();
        $uagent[] = 'gocardless-pro-php/3.0.0';
        $uagent[] = 'schema-version/2015-07-06';
        $uagent[] = 'GuzzleHttp/' . \GuzzleHttp\Client::VERSION;
        $uagent[] = 'php/' . phpversion();
        if (extension_loaded('curl') && function_exists('curl_version')) {
            $uagent[] = 'curl/' . \curl_version()['version'];
            $uagent[] = 'curl/' . \curl_version()['host'];
        }
        return implode(' ', $uagent);
    }
996823
protected function _getUserAgent()
    {
        $ua = str_replace('%v', self::VERSION, $this->userAgent);
        $ua = str_replace('%m', $this->_getUpdateMethod(), $ua);

        return $ua;
    }
565440
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = $this->getClient()->user;
        }
        return $this->_user;
    }
1302254
public function getUserService()
    {
        if (null === $this->userService) {
            $this->userService = new UserService(
                $this->client,
                $this->inputDispatcher,
                $this->outputVisitor,
                $this->requestParser
            );
        }

        return $this->userService;
    }
949616
protected function getBrowser()
    {
        if (!($this->browser instanceof Client)) {
            $this->browser = new Client($this->host);

            // try to set User-Agent from original request
            $user_agent = self::DEFAULT_USER_AGENT;
            if ($this->request) {
                $user_agent = $this->request->server->get('HTTP_USER_AGENT', self::DEFAULT_USER_AGENT);
            }
            $this->browser->setDefaultHeaders(['User-Agent' => $user_agent]);

            // configure browser client
            $this->browser->setDefaultOption('timeout', $this->timeout);
            if ($this->proxy_list) {
                $this->browser->setDefaultOption('proxy', $this->proxy_list[array_rand($this->proxy_list)]);
            }
        }

        return $this->browser;
    }
1232514
protected function determineClientUserAgent($request)
    {
        $userAgent = null;
        $serverParams = $request->getServerParams();
        $userAgent = $serverParams['HTTP_USER_AGENT'];

        $checkProxyHeaders = $this->checkProxyHeaders;
        if ($checkProxyHeaders && !empty($this->trustedProxies)) {
            if (!in_array($userAgent, $this->trustedProxies)) {
                $checkProxyHeaders = false;
            }
        }

        if ($checkProxyHeaders) {
            foreach ($this->headersToInspect as $header) {
                if ($request->hasHeader($header)) {
                    $userAgent = trim(current(explode(',', $request->getHeaderLine($header))));
                    break;
                }
            }
        }
        return $userAgent;
    }
194430
protected function getApi()
    {
        if (!$this->api) {
            $this->api = new Transport($this->user, $this->password);
        }

        return $this->api;
    }
252742
public function getUserAgentsForBucket()
    {
        if (empty($this->userAgents)) {
            $this->userAgents = $this->persistenceProvider->load($this->getPrefix(self::PREFIX_UA_BUCKET));
        }

        return $this->userAgents;
    }
1016909
public function getUserAgent($user_agent = null, $return_array = false, $full_info = false) {
		if ($full_info) { return get_browser($user_agent, $return_array); }

		return $_SERVER['HTTP_USER_AGENT'];
	}
82370
public function getAuthUser()
    {
        $user = null;
        if ($this->api_auth()->check()) {
            $user = $this->api_auth()->user();
        } else if (\Auth::check()) {
            $user = \Auth::user();
        }
        return $user;
    }
518733
public function getUserAgent() : string
    {
        $userAgent = '';

        foreach ($this->userAgentHeaders as $header) {
            if (array_key_exists($header, $this->source)
                && $this->source[$header]
            ) {
                $userAgent = $this->cleanParam($this->source[$header]);

                break;
            }
        }

        return $userAgent;
    }
91567
public static function userAgent()
    {
        if (empty(self::$USER_AGENT)) {
            self::$USER_AGENT = 'CloudinaryPHP/' . self::VERSION . ' (PHP ' . PHP_VERSION. ')';
        }

        if (empty(self::$USER_PLATFORM)) {
            return self::$USER_AGENT;
        }

        return self::$USER_PLATFORM . ' '  . self::$USER_AGENT;
    }
668162
private function _user_agent() {

        // browser version: 9 or 10
        $version = rand(9, 10);

        // windows version; here are the meanings:
        // Windows NT 6.2   ->  Windows 8                                       //  can have IE10
        // Windows NT 6.1   ->  Windows 7                                       //  can have IE9 or IE10
        // Windows NT 6.0   ->  Windows Vista                                   //  can have IE9
        $major_version = 6;

        $minor_version =

            // for IE9 Windows can have "0", "1" or "2" as minor version number
            $version == 8 || $version == 9 ? rand(0, 2) :

            // for IE10 Windows will have "2" as major version number
            2;

        // add some extra information
        $extras = rand(0, 3);

        // return the random user agent string
        return 'Mozilla/5.0 (compatible; MSIE ' . $version . '.0; Windows NT ' . $major_version . '.' . $minor_version . ($extras == 1 ? '; WOW64' : ($extras == 2 ? '; Win64; IA64' : ($extras == 3 ? '; Win64; x64' : ''))) . ')';

    }
427204
public function getUserAgentByCommonLib()
    {
        $this->autoPopulateSuperGlobals();
        if (!is_null($this->brServerGlobals->get('ua'))) {
            return $this->brServerGlobals->get('ua');
        }
        return $this->getUserAgentByCommonLibDetection();
    }
265285
public function getUserClient()
    {
        if (!$this->userClient) {
            $this->userClient = Factory::getUserClient(
                null, $this->configuration->getApiKey(), [Factory::API_BASE_URL => $this->configuration->getApiUri()]
            );
        }

        return $this->userClient;
    }
1324966
def user_agent(self):
        
        if not self._user_agent:
            session = requests.Session()
            user_agent = session.headers['User-Agent']
            self._user_agent = '%s %s' % (self.base_user_agent, user_agent)
        return self._user_agent
674474
public function getBrowser(string $userAgent = null)
    {
        // Check if an automatic update is required
        $this->autoUpdate();

        // If no user agent is set, try to get it from the HTTP headers
        if ($userAgent === null) {
            $userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
        }

        // Get rwa Browscap data and return a formatted version, using the set Formatter
        $browscapData = $this->getParser()->getReader()->getBrowser($userAgent);
        return $this->getFormatter()->format($browscapData);
    }