Os
in package
OS Detection.
Table of Contents
Constants
- ANDROID = 'Android'
- BEOS = 'BeOS'
- BLACKBERRY = 'BlackBerry'
- CHROME_OS = 'Chrome OS'
- FREEBSD = 'FreeBSD'
- IOS = 'iOS'
- LINUX = 'Linux'
- NETBSD = 'NetBSD'
- NOKIA = 'Nokia'
- OPENBSD = 'OpenBSD'
- OPENSOLARIS = 'OpenSolaris'
- OS2 = 'OS2'
- OSX = 'OS X'
- SUNOS = 'SunOS'
- SYMBOS = 'SymbOS'
- UNKNOWN = 'unknown'
- VERSION_UNKNOWN = 'unknown'
- WINDOWS = 'Windows'
- WINDOWS_PHONE = 'Windows Phone'
Properties
- $isMobile : bool
- $name : string
- $userAgent : UserAgent
- $version : string
Methods
- __construct() : mixed
- getIsMobile() : bool
- Is the browser from a mobile device?
- getName() : string
- Return the name of the OS.
- getUserAgent() : UserAgent
- getVersion() : string
- Return the version of the OS.
- isMobile() : bool
- setIsMobile() : mixed
- Set the Browser to be mobile.
- setName() : $this
- Set the name of the OS.
- setUserAgent() : $this
- setVersion() : $this
- Set the version of the OS.
Constants
ANDROID
public
mixed
ANDROID
= 'Android'
BEOS
public
mixed
BEOS
= 'BeOS'
BLACKBERRY
public
mixed
BLACKBERRY
= 'BlackBerry'
CHROME_OS
public
mixed
CHROME_OS
= 'Chrome OS'
FREEBSD
public
mixed
FREEBSD
= 'FreeBSD'
IOS
public
mixed
IOS
= 'iOS'
LINUX
public
mixed
LINUX
= 'Linux'
NETBSD
public
mixed
NETBSD
= 'NetBSD'
NOKIA
public
mixed
NOKIA
= 'Nokia'
OPENBSD
public
mixed
OPENBSD
= 'OpenBSD'
OPENSOLARIS
public
mixed
OPENSOLARIS
= 'OpenSolaris'
OS2
public
mixed
OS2
= 'OS2'
OSX
public
mixed
OSX
= 'OS X'
SUNOS
public
mixed
SUNOS
= 'SunOS'
SYMBOS
public
mixed
SYMBOS
= 'SymbOS'
UNKNOWN
public
mixed
UNKNOWN
= 'unknown'
VERSION_UNKNOWN
public
mixed
VERSION_UNKNOWN
= 'unknown'
WINDOWS
public
mixed
WINDOWS
= 'Windows'
WINDOWS_PHONE
public
mixed
WINDOWS_PHONE
= 'Windows Phone'
Properties
$isMobile
private
bool
$isMobile
= false
$name
private
string
$name
$userAgent
private
UserAgent
$userAgent
$version
private
string
$version
Methods
__construct()
public
__construct([null|string|UserAgent $userAgent = null ]) : mixed
Parameters
- $userAgent : null|string|UserAgent = null
Tags
getIsMobile()
Is the browser from a mobile device?
public
getIsMobile() : bool
Return values
boolgetName()
Return the name of the OS.
public
getName() : string
Return values
stringgetUserAgent()
public
getUserAgent() : UserAgent
Return values
UserAgentgetVersion()
Return the version of the OS.
public
getVersion() : string
Return values
stringisMobile()
public
isMobile() : bool
Return values
boolsetIsMobile()
Set the Browser to be mobile.
public
setIsMobile([bool $isMobile = true ]) : mixed
Parameters
- $isMobile : bool = true
setName()
Set the name of the OS.
public
setName(string $name) : $this
Parameters
- $name : string
Return values
$thissetUserAgent()
public
setUserAgent(UserAgent $userAgent) : $this
Parameters
- $userAgent : UserAgent
Return values
$thissetVersion()
Set the version of the OS.
public
setVersion(string $version) : $this
Parameters
- $version : string