PHP Class Jenssegers\Agent\Agent

Inheritance: extends Mobile_Detec\Mobile_Detect
Afficher le fichier Open project: jenssegers/agent Class Usage Examples

Protected Properties

Свойство Type Description
$additionalBrowsers array Note: 'Vivaldi' must be above Chrome, otherwise it'll fail
$additionalDevices array List of desktop devices.
$additionalOperatingSystems array List of additional operating systems.
$additionalProperties array List of additional properties.
$robots array List of robots.

Méthodes publiques

Méthode Description
__call ( $name, $arguments ) Changing detection type to extended.
browser ( $userAgent = null ) : string Get the browser name.
device ( string $userAgent = null ) : string Get the device name.
getDetectionRulesExtended ( ) : array Get all detection rules. These rules include the additional platforms and browsers.
getRules ( ) : array Retrieve the current set of rules.
isDesktop ( string $userAgent = null, array $httpHeaders = null ) : boolean Check if the device is a desktop computer.
isPhone ( string $userAgent = null, array $httpHeaders = null ) : boolean Check if the device is a mobile phone.
isRobot ( string $userAgent = null ) : boolean Check if device is a robot.
languages ( $acceptLanguage = null ) : array Get accept languages.
platform ( string $userAgent = null ) : string Get the platform name.
robot ( string $userAgent = null ) : string Get the robot name.
version ( $propertyName, $type = self::VERSION_TYPE_STRING ) Check the version of the given property in the User-Agent.

Méthodes protégées

Méthode Description
findDetectionRulesAgainstUA ( array $rules, null $userAgent = null ) : string Match a detection rule and return the matched key.
mergeRules ( ) : array Merge multiple rules into one array.

Method Details

__call() public méthode

Changing detection type to extended.
public __call ( $name, $arguments )

browser() public méthode

Get the browser name.
public browser ( $userAgent = null ) : string
Résultat string

device() public méthode

Get the device name.
public device ( string $userAgent = null ) : string
$userAgent string
Résultat string

findDetectionRulesAgainstUA() protected méthode

Match a detection rule and return the matched key.
protected findDetectionRulesAgainstUA ( array $rules, null $userAgent = null ) : string
$rules array
$userAgent null
Résultat string

getDetectionRulesExtended() public méthode

Get all detection rules. These rules include the additional platforms and browsers.
public getDetectionRulesExtended ( ) : array
Résultat array

getRules() public méthode

Retrieve the current set of rules.
public getRules ( ) : array
Résultat array

isDesktop() public méthode

Check if the device is a desktop computer.
public isDesktop ( string $userAgent = null, array $httpHeaders = null ) : boolean
$userAgent string deprecated
$httpHeaders array deprecated
Résultat boolean

isPhone() public méthode

Check if the device is a mobile phone.
public isPhone ( string $userAgent = null, array $httpHeaders = null ) : boolean
$userAgent string deprecated
$httpHeaders array deprecated
Résultat boolean

isRobot() public méthode

Check if device is a robot.
public isRobot ( string $userAgent = null ) : boolean
$userAgent string
Résultat boolean

languages() public méthode

Get accept languages.
public languages ( $acceptLanguage = null ) : array
Résultat array

mergeRules() protected méthode

Merge multiple rules into one array.
protected mergeRules ( ) : array
Résultat array

platform() public méthode

Get the platform name.
public platform ( string $userAgent = null ) : string
$userAgent string
Résultat string

robot() public méthode

Get the robot name.
public robot ( string $userAgent = null ) : string
$userAgent string
Résultat string

version() public méthode

Check the version of the given property in the User-Agent.
public version ( $propertyName, $type = self::VERSION_TYPE_STRING )

Property Details

$additionalBrowsers protected_oe static_oe property

Note: 'Vivaldi' must be above Chrome, otherwise it'll fail
protected static array $additionalBrowsers
Résultat array

$additionalDevices protected_oe static_oe property

List of desktop devices.
protected static array $additionalDevices
Résultat array

$additionalOperatingSystems protected_oe static_oe property

List of additional operating systems.
protected static array $additionalOperatingSystems
Résultat array

$additionalProperties protected_oe static_oe property

List of additional properties.
protected static array $additionalProperties
Résultat array

$robots protected_oe static_oe property

List of robots.
protected static array $robots
Résultat array