Http/UserAgent/AbstractDevice.php
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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Http
- Subpackage
- UserAgent
\Zend_Http_UserAgent_AbstractDevice
Abstract Class to define a browser device.
- Implements
- \Zend_Http_UserAgent_Device
- Children
- \Zend_Http_UserAgent_Bot
- \Zend_Http_UserAgent_Probe
- \Zend_Http_UserAgent_Text
- \Zend_Http_UserAgent_Feed
- \Zend_Http_UserAgent_Desktop
- \Zend_Http_UserAgent_Spam
- \Zend_Http_UserAgent_Mobile
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

array $_images = array('jpeg', 'gif', 'png', 'pjpeg', 'x-png', 'bmp')Image types
array('jpeg', 'gif', 'png', 'pjpeg', 'x-png', 'bmp')Details- Type
- array
Methods

__construct(null | string | array $userAgent = null, array $server = array(), array $config = array()) : voidConstructor
Allows injecting user agent, server array, and/or config array. If an array is provided for the first argument, the assumption should be that the device object is being seeded with cached values from serialization.
| Name | Type | Description |
|---|---|---|
| $userAgent | null | string | array | If array, restores from serialized version |
| $server | array | |
| $config | array |

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

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

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

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

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

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

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

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

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

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

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

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

match(string $userAgent, array $server) : bool | array
Return either an array of browser signature strings, or a boolean.
| Name | Type | Description |
|---|---|---|
| $userAgent | string | |
| $server | array |
| Type | Description |
|---|---|
| bool | array |

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

setFeature(string $feature, string $value = false, string $group = '') : \Zend_Http_UserAgent_AbstractDeviceSet 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_AbstractDeviceAffects a feature to a group
| Name | Type | Description |
|---|---|---|
| $group | string | Group name |
| $feature | string | Feature name |
| Type | Description |
|---|---|
| \Zend_Http_UserAgent_AbstractDevice |