Redaxscript\Client\ClientAbstract::_detect PHP Метод

_detect() защищенный Метод

detect the required type
С версии: 2.4.0
protected _detect ( array $setupArray = [], string $type = null )
$setupArray array array of client setup
$type string type of the client
    protected function _detect($setupArray = [], $type = null)
    {
        $userAgent = strtolower($this->_request->getServer('HTTP_USER_AGENT'));
        /* process setup */
        foreach ($setupArray as $key => $value) {
            if (stristr($userAgent, $value)) {
                /* general */
                $this->_output = $value;
                /* version */
                if ($type === 'version') {
                    $this->_output = floor(substr($userAgent, strpos($userAgent, $value) + strlen($value) + 1, 3));
                }
            }
        }
    }