Documentation

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

$version

private string $version

Methods

__construct()

public __construct([null|string|UserAgent $userAgent = null ]) : mixed
Parameters
$userAgent : null|string|UserAgent = null
Tags
throws
InvalidArgumentException

getIsMobile()

Is the browser from a mobile device?

public getIsMobile() : bool
Return values
bool

getName()

Return the name of the OS.

public getName() : string
Return values
string

getVersion()

Return the version of the OS.

public getVersion() : string
Return values
string

isMobile()

public isMobile() : bool
Return values
bool

setIsMobile()

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
$this

setUserAgent()

public setUserAgent(UserAgent $userAgent) : $this
Parameters
$userAgent : UserAgent
Return values
$this

setVersion()

Set the version of the OS.

public setVersion(string $version) : $this
Parameters
$version : string
Return values
$this

        
On this page

Search results