src/Web/UserAgent.php
public function init()
    {
        $device = '';
        $style = '';
        if (!isset($_SERVER['HTTP_USER_AGENT'])) {
            return;
        }
        if (stristr($_SERVER['HTTP_USER_AGENT'], 'ipad')) {
            $device = "ipad";
            $style = "touch";
        } else if (stristr($_SERVER['HTTP_USER_AGENT'], 'iphone') 
                || strstr($_SERVER['HTTP_USER_AGENT'], 'ipod')) {
            $device = "iphone";
            $style = "touch";
        } else if (stristr($_SERVER['HTTP_USER_AGENT'], 'blackberry')) {
            $device = "blackberry";
            $style = "touch";
        } else if (stristr($_SERVER['HTTP_USER_AGENT'], 'android')) {
            $device = "android";
            $style = "touch";
        }

        $this->_userAgent = $device;
        $this->_style = $style;
        if ($device != '' && $style == 'touch') {
            $this->_isTouch = true;
            $this->_device = 'mobile';
        } else {
            $this->_isTouch = false;
            $this->_device = 'desktop';
        }
    }
public function init()
    {
        $device = '';
        $style = '';
        if (!isset($_SERVER['HTTP_USER_AGENT'])) {
            return;
        }
        if (stristr($_SERVER['HTTP_USER_AGENT'], 'ipad')) {
            $device = "ipad";
            $style = "touch";
        } else if (stristr($_SERVER['HTTP_USER_AGENT'], 'iphone') 
                || strstr($_SERVER['HTTP_USER_AGENT'], 'ipod')) {
            $device = "iphone";
            $style = "touch";
        } else if (stristr($_SERVER['HTTP_USER_AGENT'], 'blackberry')) {
            $device = "blackberry";
            $style = "touch";
        } else if (stristr($_SERVER['HTTP_USER_AGENT'], 'android')) {
            $device = "android";
            $style = "touch";
        }

        $this->_userAgent = $device;
        $this->_style = $style;
        if ($device != '' && $style == 'touch') {
            $this->_isTouch = true;
            $this->_device = 'mobile';
        } else {
            $this->_isTouch = false;
            $this->_device = 'desktop';
        }
    }
put your code here