Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Abstract Class to define a browser device.

__construct(
null|string|array $userAgent
=
null, array $server
=
array(), array $config
=
array()
)
:
void
Constructor
Name | Type | Description |
---|---|---|
$userAgent | null|string|array | If array, restores from serialized version |
$server | array | |
$config | array |

_getDefaultFeatures(
)
:
void
Sets all the standard features extracted from the User Agent chain and $this->_server vars

_loadFeaturesAdapter(
)
:
array
Loads the Features Adapter if it's defined in the $config array Otherwise, nothing is done
Type | Description |
---|---|
array |

_matchAgentAgainstSignatures(
string $userAgent, array $signatures
)
:
bool
Match a user agent string against a list of signatures
Name | Type | Description |
---|---|---|
$userAgent | string | |
$signatures | array |
Type | Description |
---|---|
bool |

_restoreFromArray(
array $spec
)
:
void
Restore object state from array
Name | Type | Description |
---|---|---|
$spec | array |

extractFromUserAgent(
string $userAgent
)
:
array
Extract and sets informations from the User Agent chain
Name | Type | Description |
---|---|---|
$userAgent | string | User Agent chain |
Type | Description |
---|---|
array |

getFeature(
string $feature
)
:
string|null
Gets the value of the current browser/device feature
Name | Type | Description |
---|---|---|
$feature | string | Feature to search |
Type | Description |
---|---|
string|null |

getGroup(
string $group
)
:
array
Gets an array of features associated to a group
Name | Type | Description |
---|---|---|
$group | string | Group param |
Type | Description |
---|---|
array |

getMaxImageHeight(
)
:
int
Get maximum image height supported by this device
Type | Description |
---|---|
int |

getMaxImageWidth(
)
:
int
Get maximum image width supported by this device
Type | Description |
---|---|
int |

getPhysicalScreenHeight(
)
:
int
Get physical screen height of this device
Type | Description |
---|---|
int |

getPhysicalScreenWidth(
)
:
int
Get physical screen width of this device
Type | Description |
---|---|
int |

hasFeature(
string $feature
)
:
bool
Check a feature for the current browser/device.
Name | Type | Description |
---|---|---|
$feature | string | The feature to check. |
Type | Description |
---|---|
bool |

hasPhoneNumber(
)
:
bool
Does the device have a phone number associated with it?
Type | Description |
---|---|
bool |

setBrowserVersion(
string $browserVersion
)
:
void
Name | Type | Description |
---|---|---|
$browserVersion | string |

setFeature(
string $feature, string $value
=
false, string $group
=
''
)
:
\Zend_Http_UserAgent_AbstractDevice
Set a feature for the current browser/device.
Name | Type | Description |
---|---|---|
$feature | string | The feature to set. |
$value | string | (option) feature value. |
$group | string | (option) Group to associate with the feature |
Type | Description |
---|---|
\Zend_Http_UserAgent_AbstractDevice |

setGroup(
string $group, string $feature
)
:
\Zend_Http_UserAgent_AbstractDevice
Affects a feature to a group
Name | Type | Description |
---|---|---|
$group | string | Group name |
$feature | string | Feature name |
Type | Description |
---|---|
\Zend_Http_UserAgent_AbstractDevice |