WebClient
Class to model a Web Client.
property-read |
The detected platform on which the web client runs. True if the web client is a mobile device. The detected rendering engine used by the web client. The detected browser used by the web client. The detected browser version used by the web client. The priority order detected accepted languages for the client. The priority order detected accepted encodings for the client. The web client's user agent string. The web client's accepted encoding string. The web client's accepted languages string. An array of flags determining whether or not a detection routine has been run. True if the web client is a robot An array of all headers sent by client |
---|---|
since |
1.0 |
Methods
__construct
Class constructor.
__construct(string $userAgent = null, string $acceptEncoding = null, string $acceptLanguage = null)
since |
1.0 |
---|
Arguments
- $userAgent
string
The optional user-agent string to parse.- $acceptEncoding
string
The optional client accept encoding string to parse.- $acceptLanguage
string
The optional client accept language string to parse.
__get
Magic method to get an object property's value by name.
__get(string $name) : mixed
since |
1.0 |
---|
Arguments
- $name
string
Name of the property for which to return a value.
Response
mixed
The requested value if it exists.
detectBrowser
Detects the client browser and version in a user agent string.
detectBrowser(string $userAgent) : void
since |
1.0 |
---|
Arguments
- $userAgent
string
The user-agent string to parse.
detectEncoding
Method to detect the accepted response encoding by the client.
detectEncoding(string $acceptEncoding) : void
since |
1.0 |
---|
Arguments
- $acceptEncoding
string
The client accept encoding string to parse.
detectEngine
Detects the client rendering engine in a user agent string.
detectEngine(string $userAgent) : void
since |
1.0 |
---|
Arguments
- $userAgent
string
The user-agent string to parse.
detectHeaders
Fills internal array of headers
detectHeaders() : void
since |
1.3.0 |
---|
detectLanguage
Method to detect the accepted languages by the client.
detectLanguage(mixed $acceptLanguage) : void
since |
1.0 |
---|
Arguments
- $acceptLanguage
mixed
The client accept language string to parse.
detectPlatform
Detects the client platform in a user agent string.
detectPlatform(string $userAgent) : void
since |
1.0 |
---|
Arguments
- $userAgent
string
The user-agent string to parse.
detectRobot
Determines if the browser is a robot or not.
detectRobot(string $userAgent) : void
since |
1.0 |
---|
Arguments
- $userAgent
string
The user-agent string to parse.
Constants
WINDOWS
Value | 1 |
---|
Type(s)
WINDOWS_PHONE
Value | 2 |
---|
Type(s)
WINDOWS_CE
Value | 3 |
---|
Type(s)
IPHONE
Value | 4 |
---|
Type(s)
IPAD
Value | 5 |
---|
Type(s)
IPOD
Value | 6 |
---|
Type(s)
MAC
Value | 7 |
---|
Type(s)
BLACKBERRY
Value | 8 |
---|
Type(s)
ANDROID
Value | 9 |
---|
Type(s)
LINUX
Value | 10 |
---|
Type(s)
TRIDENT
Value | 11 |
---|
Type(s)
WEBKIT
Value | 12 |
---|
Type(s)
GECKO
Value | 13 |
---|
Type(s)
PRESTO
Value | 14 |
---|
Type(s)
KHTML
Value | 15 |
---|
Type(s)
AMAYA
Value | 16 |
---|
Type(s)
IE
Value | 17 |
---|
Type(s)
FIREFOX
Value | 18 |
---|
Type(s)
CHROME
Value | 19 |
---|
Type(s)
SAFARI
Value | 20 |
---|
Type(s)
OPERA
Value | 21 |
---|
Type(s)
ANDROIDTABLET
Value | 22 |
---|
Type(s)
EDGE
Value | 23 |
---|
Type(s)
BLINK
Value | 24 |
---|
Type(s)
EDG
Value | 25 |
---|
Type(s)
Properties
platform
The detected platform on which the web client runs.
since |
1.0 |
---|
Type(s)
integer
mobile
True if the web client is a mobile device.
since |
1.0 |
---|
Type(s)
boolean
engine
The detected rendering engine used by the web client.
since |
1.0 |
---|
Type(s)
integer
browser
The detected browser used by the web client.
since |
1.0 |
---|
Type(s)
integer
browserVersion
The detected browser version used by the web client.
since |
1.0 |
---|
Type(s)
string
languages
The priority order detected accepted languages for the client.
since |
1.0 |
---|
Type(s)
array
encodings
The priority order detected accepted encodings for the client.
since |
1.0 |
---|
Type(s)
array
userAgent
The web client's user agent string.
since |
1.0 |
---|
Type(s)
string
acceptEncoding
The web client's accepted encoding string.
since |
1.0 |
---|
Type(s)
string
acceptLanguage
The web client's accepted languages string.
since |
1.0 |
---|
Type(s)
string
robot
True if the web client is a robot.
since |
1.0 |
---|
Type(s)
boolean
detection
An array of flags determining whether or not a detection routine has been run.
since |
1.0 |
---|
Type(s)
array
headers
An array of headers sent by client
since |
1.3.0 |
---|
Type(s)
array
platform
The detected platform on which the web client runs.
Type(s)
integer
mobile
True if the web client is a mobile device.
Type(s)
boolean
engine
The detected rendering engine used by the web client.
Type(s)
integer
browser
The detected browser used by the web client.
Type(s)
integer
browserVersion
The detected browser version used by the web client.
Type(s)
string
languages
The priority order detected accepted languages for the client.
Type(s)
array
encodings
The priority order detected accepted encodings for the client.
Type(s)
array
userAgent
The web client's user agent string.
Type(s)
string
acceptEncoding
The web client's accepted encoding string.
Type(s)
string
acceptLanguage
The web client's accepted languages string.
Type(s)
string
detection
An array of flags determining whether or not a detection routine has been run.
Type(s)
array
robot
True if the web client is a robot
Type(s)
boolean
headers
An array of all headers sent by client
Type(s)
array