PHP Class phpUserAgent, php-user-agent

Exibir arquivo Open project: ornicar/php-user-agent Class Usage Examples

Protected Properties

Property Type Description
$browserName
$browserVersion
$engine
$operatingSystem
$userAgentString

Public Methods

Method Description
__construct ( $userAgentString = null, phpUserAgentStringParser $userAgentStringParser = null )
__toString ( )
configureFromUserAgentString ( string $userAgentString, phpUserAgentStringParser $userAgentStringParser = null ) Configure the user agent from a user agent string
fromArray ( array $data ) Configure the user agent from a data array
getBrowserName ( ) : string Get the browser name
getBrowserVersion ( ) : string Get the browser version
getEngine ( ) : string Get the engine name
getFullName ( ) : string
getOperatingSystem ( ) : string Get the operating system name
getUserAgentString ( ) : string Get the user agent string
isUnknown ( ) : boolean Tell whether this user agent is unknown or not
setBrowserName ( string $name ) Set the browser name
setBrowserVersion ( string $version ) Set the browser version
setEngine ( $engine ) Set the engine name
setOperatingSystem ( string $operatingSystem ) Set the operating system name
setUserAgentString ( string $userAgentString ) Set the user agent string
toArray ( ) : array Convert the user agent to a data array

Method Details

__construct() public method

public __construct ( $userAgentString = null, phpUserAgentStringParser $userAgentStringParser = null )
$userAgentStringParser phpUserAgentStringParser

__toString() public method

public __toString ( )

configureFromUserAgentString() public method

Configure the user agent from a user agent string
public configureFromUserAgentString ( string $userAgentString, phpUserAgentStringParser $userAgentStringParser = null )
$userAgentString string the user agent string
$userAgentStringParser phpUserAgentStringParser the parser used to parse the string

fromArray() public method

Configure the user agent from a data array
public fromArray ( array $data )
$data array

getBrowserName() public method

Get the browser name
public getBrowserName ( ) : string
return string the browser name

getBrowserVersion() public method

Get the browser version
public getBrowserVersion ( ) : string
return string the browser version

getEngine() public method

Get the engine name
public getEngine ( ) : string
return string the engine name

getFullName() public method

public getFullName ( ) : string
return string combined browser name and version

getOperatingSystem() public method

Get the operating system name
public getOperatingSystem ( ) : string
return string the operating system name

getUserAgentString() public method

Get the user agent string
public getUserAgentString ( ) : string
return string the user agent string

isUnknown() public method

Tell whether this user agent is unknown or not
public isUnknown ( ) : boolean
return boolean true if this user agent is unknown, false otherwise

setBrowserName() public method

Set the browser name
public setBrowserName ( string $name )
$name string the browser name

setBrowserVersion() public method

Set the browser version
public setBrowserVersion ( string $version )
$version string the browser version

setEngine() public method

Set the engine name
public setEngine ( $engine )

setOperatingSystem() public method

Set the operating system name
public setOperatingSystem ( string $operatingSystem )
$operatingSystem string the operating system name

setUserAgentString() public method

Set the user agent string
public setUserAgentString ( string $userAgentString )
$userAgentString string the user agent string

toArray() public method

Convert the user agent to a data array
public toArray ( ) : array
return array data

Property Details

$browserName protected_oe property

protected $browserName

$browserVersion protected_oe property

protected $browserVersion

$engine protected_oe property

protected $engine

$operatingSystem protected_oe property

protected $operatingSystem

$userAgentString protected_oe property

protected $userAgentString