Get User Agent

@return string|null
556562
public function getUserAgent()
    {
        if ($this->USER_AGENT) {
            return $this->USER_AGENT;
        }

        if ($this->HTTP_USER_AGENT) {
            return $this->HTTP_USER_AGENT;
        }

        return null;
    }
795065
public function getUser()
    {
        if (! $this->_user) {
            $request = $this->getRequest();

            $this->_user = $this->loader->getUser($request->getParam($this->usernameFieldName), $request->getParam($this->organizationFieldName));
        }
        return $this->_user;
    }
492096
private function getUserGroup()
    {
        if (null !== $token = $this->tokenStorage->getToken()) {
            /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
            if (null !== $user = $token->getUser()) {
                return $user->getGroup();
            }
        }
        return null;
    }
567098
public function getUserAgentName()
    {
        static $user_agent_name = '';

        if (empty($user_agent_name)) {
            $user_agent_name = 'B2BApi Client/' . $this->api_client->getClientVersion() . ' curl/'
                . \curl_version()['version'] . ' PHP/' . PHP_VERSION;
        }

        return $user_agent_name;
    }
718908
public function getAuthor()
    {
        $user = null;

        if($this->hasProperty('created_by') && !empty($this->created_by)) {
            $user = $this->getObject('user.provider')->getUser($this->created_by);
        }

        return $user;
    }
996823
protected function _getUserAgent()
    {
        $ua = str_replace('%v', self::VERSION, $this->userAgent);
        $ua = str_replace('%m', $this->_getUpdateMethod(), $ua);

        return $ua;
    }
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;
    }
1157981
public function getIsRobot()
    {
        if (!isset($this->name)) {
            BrowserDetector::detect($this, $this->getUserAgent());
        }

        return $this->isRobot;
    }
997267
public function getDefaultUserAgent(): string
    {
        $defaultAgent = 'Swoft/' . App::version();
        if (\extension_loaded('curl') && \function_exists('curl_version')) {
            $defaultAgent .= ' curl/' . \curl_version()['version'];
        }
        $defaultAgent .= ' PHP/' . PHP_VERSION;
        return $defaultAgent;
    }
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;
    }
1344474
protected function gatherUserAgentData()
    {
        // User agent container
        $userAgents = ['original' => null, 'nodes_meta' => null];

        // Retrieve original user agent
        $originalUserAgent = user_agent();
        if (!empty($originalUserAgent)) {
            $userAgents['original'] = [
                'browser'  => $originalUserAgent->getBrowserWithVersion(),
                'platform' => $originalUserAgent->getPlatform(),
                'device'   => $originalUserAgent->getDevice(),
                'isMobile' => $originalUserAgent->isMobile(),
                'isTablet' => $originalUserAgent->isTablet(),
            ];
        }

        // Retrieve nodes user agent
        $nodesUserAgent = nodes_meta();
        if (!empty($nodesUserAgent)) {
            $userAgents['nodes_meta'] = [
                'version'  => $nodesUserAgent->getVersion(),
                'platform' => $nodesUserAgent->getPlatform(),
                'device'   => $nodesUserAgent->getDevice(),
            ];
        }

        return $userAgents;
    }
90265
public function getuser(){
		if(empty($this->user)){
			return NULL;
			}
		bimport('users.general');
		$bu=BUsers::getInstance();
		$user=$bu->itemGet($this->user);
		return $user;
		}
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);
    }
273019
public function setUserAgent($userAgent = null)
        {
            if (!empty($userAgent)) {
                return $this->userAgent = $userAgent;
            } else {
                $this->userAgent = null;
                foreach($this->getUaHttpHeaders() as $altHeader) {
                    if(!empty($this->httpHeaders[$altHeader])) { // @todo: should use getHttpHeader(), but it would be slow. (Serban)
                        $this->userAgent .= $this->httpHeaders[$altHeader] . " ";
                    }
                }
                return $this->userAgent = (!empty($this->userAgent) ? trim($this->userAgent) : null);
            }
        }
467084
public static function getUserAgentProfile($request)
    {
        if (isset($request["HTTP_X_WAP_PROFILE"])) {
            return $request["HTTP_X_WAP_PROFILE"];
        }
        if (isset($request["HTTP_PROFILE"])) {
            return $request["HTTP_PROFILE"];
        }
        if (isset($request["Opt"])) {
            $opt = $request["Opt"];
            $regex = "/ns=\\d+/";
            $matches = array();
            $namespaceProfile = null;
            if (preg_match($regex, $opt, $matches)) {
                $namespaceProfile = substr($matches[0], 2) . "-Profile";
            }
            if ($namespaceProfile !== null && isset($request[$namespaceProfile])) {
                return $request[$namespaceProfile];
            }
        }

        return null;
    }
980775
public function getUser()
    {
        if (null !== $this->user) {
            return $this->user;
        }

        $this->parseUserInfo();

        return $this->user;
    }
459984
public static function getDefaultUserAgent()
    {
        static $defaultAgent = '';
        if (!$defaultAgent) {
            $defaultAgent = 'Guzzle/' . ClientInterface::VERSION;
            if (extension_loaded('curl')) {
                $defaultAgent .= ' curl/' . curl_version()['version'];
            }
            $defaultAgent .= ' PHP/' . PHP_VERSION;
        }

        return $defaultAgent;
    }