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