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(string userAgent = null, string acceptEncoding = null, string acceptLanguage = null) : mixed
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(string name) : mixed
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(string userAgent) : void
since

1.0.0

Arguments

userAgent

stringThe user-agent string to parse.

detectEncoding

Method to detect the accepted response encoding by the client.

detectEncoding(string acceptEncoding) : void
since

1.0.0

Arguments

acceptEncoding

stringThe client accept encoding string to parse.

detectEngine

Detects the client rendering engine in a user agent string.

detectEngine(string userAgent) : void
since

1.0.0

Arguments

userAgent

stringThe 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.0

Arguments

acceptLanguage

mixedThe client accept language string to parse.

detectPlatform

Detects the client platform in a user agent string.

detectPlatform(string userAgent) : void
since

1.0.0

Arguments

userAgent

stringThe user-agent string to parse.

detectRobot

Determines if the browser is a robot or not.

detectRobot(string userAgent) : void
since

1.0.0

Arguments

userAgent

stringThe user-agent string to parse.

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

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

encodings

The priority order detected accepted encodings for the client.

since

1.0.0

Type(s)

array

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

robot

True if the web client is a robot.

since

1.0.0

Type(s)

bool

detection

An array of flags determining whether or not a detection routine has been run.

since

1.0.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)

int

mobile

True if the web client is a mobile device.

Type(s)

bool

engine

The detected rendering engine used by the web client.

Type(s)

int

browser

The detected browser used by the web client.

Type(s)

int

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 a detection routine has been run.

Type(s)

array

robot

True if the web client is a robot

Type(s)

bool

headers

An array of all headers sent by client

Type(s)

array