Zend Framework
1.12
|
Public Member Functions | |
__construct ($options=null) | |
Constructor. | |
serialize () | |
Serialized representation of the object. | |
unserialize ($serialized) | |
Unserialize a previous representation of the object. | |
setOptions ($options) | |
Configure instance. | |
getUserAgent () | |
Returns the User Agent value. | |
setUserAgent ($userAgent) | |
Force or replace the UA chain in $_server variable. | |
getHttpAccept ($httpAccept=null) | |
Returns the HTTP Accept server param. | |
setHttpAccept ($httpAccept) | |
Force or replace the HTTP_ACCEPT chain in self::$_server variable. | |
getStorage ($browser=null) | |
Returns the persistent storage handler. | |
setStorage (Zend_Http_UserAgent_Storage $storage) | |
Sets the persistent storage handler. | |
clearStorage ($browser=null) | |
Clean the persistent storage. | |
getConfig () | |
Get user configuration. | |
setConfig ($config=array()) | |
Config parameters is an Array or a Zend_Config object. | |
getDevice () | |
Returns the device object. | |
getBrowserType () | |
Retrieve the browser type. | |
setBrowserType ($browserType) | |
Set the browser "type". | |
getServer () | |
Retrieve the "$_SERVER" array. | |
setServer ($server) | |
Set the "$_SERVER" array. | |
getServerValue ($key) | |
Retrieve a server value. | |
setServerValue ($key, $value) | |
Set a server value. | |
setPluginLoader ($type, $loader) | |
Set plugin loader. | |
getPluginLoader ($type) | |
Get a plugin loader. | |
Public Attributes | |
const | DEFAULT_IDENTIFICATION_SEQUENCE = 'mobile,desktop' |
'desktop' by default if the sequence return false for each item or is empty | |
const | DEFAULT_PERSISTENT_STORAGE_ADAPTER = 'Session' |
Default persitent storage adapter : Session or NonPersitent. | |
const | DEFAULT_BROWSER_TYPE = 'desktop' |
'desktop' by default if the sequence return false for each item | |
const | DEFAULT_HTTP_USER_AGENT = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)' |
Default User Agent chain to prevent empty value. | |
const | DEFAULT_HTTP_ACCEPT = "application/xhtml+xml" |
Default Http Accept param to prevent empty value. | |
const | DEFAULT_MARKUP_LANGUAGE = "xhtml" |
Default markup language. | |
Protected Member Functions | |
_match ($deviceClass) | |
Comparison of the UserAgent chain and browser signatures. | |
_getUserAgentDevice ($browserType) | |
Loads class for a user agent device. | |
_validateLoaderType ($type) | |
Validate a plugin loader type. | |
_matchUserAgent () | |
Run the identification sequence to match the right browser type according to the user agent. | |
_createDevice () | |
Creates device object instance. | |
Protected Attributes | |
$_browserType | |
$_browserTypeClass = array() | |
$_config | |
$_device | |
$_immutable = false | |
$_loaders = array() | |
$_loaderTypes = array('storage', 'device') | |
$_matchLog = array() | |
$_server | |
$_storage | |
__construct | ( | $options = null | ) |
|
protected |
Creates device object instance.
|
protected |
Loads class for a user agent device.
string | $browserType | Browser type |
Zend_Loader_PluginLoader_Exception | if unable to load UA device |
|
protected |
Comparison of the UserAgent chain and browser signatures.
The comparison is case-insensitive : the browser signatures must be in lower case
string | $deviceClass | Name of class against which a match will be attempted |
|
protected |
Run the identification sequence to match the right browser type according to the user agent.
|
protected |
Validate a plugin loader type.
Verifies that it is in $_loaderTypes, and returns a normalized version of the type.
string | $type |
Zend_Http_UserAgent_Exception | on invalid type |
clearStorage | ( | $browser = null | ) |
Clean the persistent storage.
string | $browser | Browser identifier (User Agent chain) |
getBrowserType | ( | ) |
Retrieve the browser type.
getConfig | ( | ) |
Get user configuration.
getDevice | ( | ) |
Returns the device object.
This is the object that will contain the various discovered device capabilities.
getHttpAccept | ( | $httpAccept = null | ) |
Returns the HTTP Accept server param.
string | $httpAccept | (option) forced HTTP Accept chain |
getPluginLoader | ( | $type | ) |
Get a plugin loader.
string | $type | A valid plugin loader type; see $_loaderTypes |
getServer | ( | ) |
Retrieve the "$_SERVER" array.
Basically, the $_SERVER array or an equivalent container storing the data that will be introspected.
If the value has not been previously set, it sets itself from the $_SERVER superglobal.
getServerValue | ( | $key | ) |
Retrieve a server value.
string | $key |
getStorage | ( | $browser = null | ) |
Returns the persistent storage handler.
Session storage is used by default unless a different storage adapter has been set via the "persistent_storage_adapter" key. That key should contain either a fully qualified class name, or a short name that resolves via the plugin loader.
string | $browser | Browser identifier (User Agent chain) |
getUserAgent | ( | ) |
Returns the User Agent value.
If $userAgent param is null, the value of $_server['HTTP_USER_AGENT'] is returned.
serialize | ( | ) |
Serialized representation of the object.
setBrowserType | ( | $browserType | ) |
setConfig | ( | $config = array() | ) |
Config parameters is an Array or a Zend_Config object.
The allowed parameters are :
mixed | $config | (option) Config array |
setHttpAccept | ( | $httpAccept | ) |
Force or replace the HTTP_ACCEPT chain in self::$_server variable.
string | $httpAccept | Forced HTTP Accept chain |
setOptions | ( | $options | ) |
setPluginLoader | ( | $type, | |
$loader | |||
) |
Set plugin loader.
string | $type | Type of plugin loader; one of 'storage', (?) |
string | Zend_Loader_PluginLoader | $loader |
setServer | ( | $server | ) |
Set the "$_SERVER" array.
Basically, the $_SERVER array or an equivalent container storing the data that will be introspected.
array | ArrayAccess | $server |
Zend_Http_UserAgent_Exception | on invalid parameter |
setServerValue | ( | $key, | |
$value | |||
) |
Set a server value.
string | int | float | $key | |
mixed | $value |
setStorage | ( | Zend_Http_UserAgent_Storage | $storage | ) |
Sets the persistent storage handler.
Zend_Http_UserAgent_Storage | $storage |
setUserAgent | ( | $userAgent | ) |
Force or replace the UA chain in $_server variable.
string | $userAgent | Forced UserAgent chain |
unserialize | ( | $serialized | ) |
Unserialize a previous representation of the object.
string | $serialized |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const DEFAULT_BROWSER_TYPE = 'desktop' |
'desktop' by default if the sequence return false for each item
const DEFAULT_HTTP_ACCEPT = "application/xhtml+xml" |
Default Http Accept param to prevent empty value.
const DEFAULT_HTTP_USER_AGENT = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)' |
Default User Agent chain to prevent empty value.
const DEFAULT_IDENTIFICATION_SEQUENCE = 'mobile,desktop' |
'desktop' by default if the sequence return false for each item or is empty
const DEFAULT_MARKUP_LANGUAGE = "xhtml" |
Default markup language.
const DEFAULT_PERSISTENT_STORAGE_ADAPTER = 'Session' |
Default persitent storage adapter : Session or NonPersitent.