PHP Class Zend_Http_UserAgent_AbstractDevice

Inheritance: implements Zend_Http_UserAgent_Device
Datei anzeigen Open project: dbpatch/dbpatch Class Usage Examples

Protected Properties

Property Type Description
$_aFeatures array Browser/Device features
$_aGroup array Browser/Device features groups
$_browser string Browser signature
$_browserVersion string Browser version
$_config array Configuration
$_images array Image types
$_server array Server variable
$_userAgent string User Agent chain

Public Methods

Method Description
__construct ( null | string | array $userAgent = null, array $server = [], array $config = [] ) : void Constructor
extractFromUserAgent ( string $userAgent ) : array Extract and sets informations from the User Agent chain
getAllFeatures ( ) : array Gets all the browser/device features
getAllGroups ( ) : array Gets all the browser/device features' groups
getBrowser ( ) : string Get the browser type
getBrowserVersion ( ) : string Get the browser version
getFeature ( string $feature ) : string | null Gets the value of the current browser/device feature
getGroup ( string $group ) : array Gets an array of features associated to a group
getImageFormatSupport ( ) : array Retrieve image format support
getImages ( ) : the
getMaxImageHeight ( ) : integer Get maximum image height supported by this device
getMaxImageWidth ( ) : integer Get maximum image width supported by this device
getPhysicalScreenHeight ( ) : integer Get physical screen height of this device
getPhysicalScreenWidth ( ) : integer Get physical screen width of this device
getPreferredMarkup ( ) : string Get preferred markup type
getType ( ) : string Gets the browser type identifier
getUserAgent ( ) : string Get the user agent string
getXhtmlSupportLevel ( ) : integer Get supported X/HTML version
hasFeature ( string $feature ) : boolean Check a feature for the current browser/device.
hasFlashSupport ( ) : boolean Does the device support Flash?
hasPdfSupport ( ) : boolean Does the device support PDF?
hasPhoneNumber ( ) : boolean Does the device have a phone number associated with it?
httpsSupport ( ) : boolean Does the device support HTTPS?
serialize ( ) : string Serialize object
setBrowser ( string $browser )
setBrowserVersion ( string $browserVersion )
setFeature ( string $feature, string $value = false, string $group = '' ) : Zend_Http_UserAgent_AbstractDevice Set a feature for the current browser/device.
setGroup ( string $group, string $feature ) : Zend_Http_UserAgent_AbstractDevice Affects a feature to a group
setImages ( array $_images )
setUserAgent ( string $userAgent )
unserialize ( string $serialized ) : void Unserialize

Protected Methods

Method Description
_defineFeatures ( ) : array | null Look for features
_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
_matchAgentAgainstSignatures ( string $userAgent, array $signatures ) : boolean Match a user agent string against a list of signatures
_restoreFromArray ( array $spec ) : void Restore object state from array

Method Details

__construct() public method

Constructor
public __construct ( null | string | array $userAgent = null, array $server = [], array $config = [] ) : void
$userAgent null | string | array If array, restores from serialized version
$server array
$config array
return void

_defineFeatures() protected method

Look for features
protected _defineFeatures ( ) : array | null
return array | null

_getDefaultFeatures() protected method

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

_loadFeaturesAdapter() protected method

Loads the Features Adapter if it's defined in the $config array Otherwise, nothing is done
protected _loadFeaturesAdapter ( ) : array
return array

_matchAgentAgainstSignatures() protected static method

Match a user agent string against a list of signatures
protected static _matchAgentAgainstSignatures ( string $userAgent, array $signatures ) : boolean
$userAgent string
$signatures array
return boolean

_restoreFromArray() protected method

Restore object state from array
protected _restoreFromArray ( array $spec ) : void
$spec array
return void

extractFromUserAgent() public static method

Extract and sets informations from the User Agent chain
public static extractFromUserAgent ( string $userAgent ) : array
$userAgent string User Agent chain
return array

getAllFeatures() public method

Gets all the browser/device features
public getAllFeatures ( ) : array
return array

getAllGroups() public method

Gets all the browser/device features' groups
public getAllGroups ( ) : array
return array

getBrowser() public method

Get the browser type
public getBrowser ( ) : string
return string

getBrowserVersion() public method

Get the browser version
public getBrowserVersion ( ) : string
return string

getFeature() public method

Gets the value of the current browser/device feature
public getFeature ( string $feature ) : string | null
$feature string Feature to search
return string | null

getGroup() public method

Gets an array of features associated to a group
public getGroup ( string $group ) : array
$group string Group param
return array

getImageFormatSupport() public method

Retrieve image format support
public getImageFormatSupport ( ) : array
return array

getImages() public method

public getImages ( ) : the
return the $_images

getMaxImageHeight() public method

Get maximum image height supported by this device
public getMaxImageHeight ( ) : integer
return integer

getMaxImageWidth() public method

Get maximum image width supported by this device
public getMaxImageWidth ( ) : integer
return integer

getPhysicalScreenHeight() public method

Get physical screen height of this device

getPhysicalScreenWidth() public method

Get physical screen width of this device
public getPhysicalScreenWidth ( ) : integer
return integer

getPreferredMarkup() public method

Get preferred markup type
public getPreferredMarkup ( ) : string
return string

getType() abstract public method

Gets the browser type identifier
abstract public getType ( ) : string
return string

getUserAgent() public method

Get the user agent string
public getUserAgent ( ) : string
return string

getXhtmlSupportLevel() public method

Get supported X/HTML version
public getXhtmlSupportLevel ( ) : integer
return integer

hasFeature() public method

Check a feature for the current browser/device.
public hasFeature ( string $feature ) : boolean
$feature string The feature to check.
return boolean

hasFlashSupport() public method

Does the device support Flash?
public hasFlashSupport ( ) : boolean
return boolean

hasPdfSupport() public method

Does the device support PDF?
public hasPdfSupport ( ) : boolean
return boolean

hasPhoneNumber() public method

Does the device have a phone number associated with it?
public hasPhoneNumber ( ) : boolean
return boolean

httpsSupport() public method

Does the device support HTTPS?
public httpsSupport ( ) : boolean
return boolean

serialize() public method

Serialize object
public serialize ( ) : string
return string

setBrowser() public method

public setBrowser ( string $browser )
$browser string

setBrowserVersion() public method

public setBrowserVersion ( string $browserVersion )
$browserVersion string

setFeature() public method

Set a feature for the current browser/device.
public setFeature ( string $feature, string $value = false, string $group = '' ) : Zend_Http_UserAgent_AbstractDevice
$feature string The feature to set.
$value string (option) feature value.
$group string (option) Group to associate with the feature
return Zend_Http_UserAgent_AbstractDevice

setGroup() public method

Affects a feature to a group
public setGroup ( string $group, string $feature ) : Zend_Http_UserAgent_AbstractDevice
$group string Group name
$feature string Feature name
return Zend_Http_UserAgent_AbstractDevice

setImages() public method

public setImages ( array $_images )
$_images array

setUserAgent() public method

public setUserAgent ( string $userAgent )
$userAgent string

unserialize() public method

Unserialize
public unserialize ( string $serialized ) : void
$serialized string
return void

Property Details

$_aFeatures protected_oe property

Browser/Device features
protected array $_aFeatures
return array

$_aGroup protected_oe property

Browser/Device features groups
protected array $_aGroup
return array

$_browser protected_oe property

Browser signature
protected string $_browser
return string

$_browserVersion protected_oe property

Browser version
protected string $_browserVersion
return string

$_config protected_oe property

Configuration
protected array $_config
return array

$_images protected_oe property

Image types
protected array $_images
return array

$_server protected_oe property

Server variable
protected array $_server
return array

$_userAgent protected_oe property

User Agent chain
protected string $_userAgent
return string