protected function getShortOsName(Request $request)
    {
        $os = strtolower($request->headers->get('User-Agent'));

        if(false !== strpos($os, 'linux'))
        {
           return 'linux';
        }

        if((false !== strpos($os, 'macintosh')) || (false !== strpos($os, 'mac os x')))
        {
            return 'mac';
        }

        return 'windows';
    }
protected function getShortOsName(Request $request)
    {
        $os = strtolower($request->headers->get('User-Agent'));

        if(false !== strpos($os, 'linux'))
        {
           return 'linux';
        }

        if((false !== strpos($os, 'macintosh')) || (false !== strpos($os, 'mac os x')))
        {
            return 'mac';
        }

        return 'windows';
    }
protected function getShortOsName ( Request $ request ) { $ os = strtolower ( $ request -> headers -> get ( 'User-Agent' ) ) ; if ( false !== strpos ( $ os , 'linux' ) ) { return 'linux' ; } if ( ( false !== strpos ( $ os , 'macintosh' ) ) || ( false !== strpos ( $ os , 'mac os x' ) ) ) { return 'mac' ; } return 'windows' ; }
Detect OS based on User-Agent header

@return string
Detect OS based on User - Agent header