Http/UserAgent/AbstractDevice.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Http  
Subpackage
UserAgent  

\Zend_Http_UserAgent_AbstractDevice

Package: Zend_Http\UserAgent
Abstract Class to define a browser device.
Implements
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-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedarray $_aFeatures = array()
Browser/Device features
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_aGroup = array()
Browser/Device features groups
Default valuearray()Details
Type
array
>VPropertyprotectedstring $_browser = ''
Browser signature
Default value''Details
Type
string
>VPropertyprotectedstring $_browserVersion = ''
Browser version
Default value''Details
Type
string
>VPropertyprotectedarray $_config
Configuration
Details
Type
array
>VPropertyprotectedarray $_images = array('jpeg', 'gif', 'png', 'pjpeg', 'x-png', 'bmp')
Image types
Default valuearray('jpeg', 'gif', 'png', 'pjpeg', 'x-png', 'bmp')Details
Type
array
>VPropertyprotectedarray $_server
Server variable
Details
Type
array
>VPropertyprotectedstring $_userAgent
User Agent chain
Details
Type
string

Methods

methodpublic__construct(null | string | array $userAgent = null, array $server = array(), array $config = array()) : void

Constructor

Parameters
NameTypeDescription
$userAgentnull | string | array

If array, restores from serialized version

$serverarray
$configarray
methodprotected_defineFeatures() : array | null

Look for features

Returns
TypeDescription
array | null
methodprotected_getDefaultFeatures() : void

Sets all the standard features extracted from the User Agent chain and $this->_server vars

methodprotected_loadFeaturesAdapter() : array

Loads the Features Adapter if it's defined in the $config array Otherwise, nothing is done

Returns
TypeDescription
array
methodprotected_matchAgentAgainstSignatures(string $userAgent, array $signatures) : bool
static

Match a user agent string against a list of signatures

Parameters
NameTypeDescription
$userAgentstring
$signaturesarray
Returns
TypeDescription
bool
methodprotected_restoreFromArray(array $spec) : void

Restore object state from array

Parameters
NameTypeDescription
$specarray
methodpublicextractFromUserAgent(string $userAgent) : array
static

Extract and sets informations from the User Agent chain

Parameters
NameTypeDescription
$userAgentstring

User Agent chain

Returns
TypeDescription
array
methodpublicgetAllFeatures() : array

Gets all the browser/device features

Returns
TypeDescription
array
methodpublicgetAllGroups() : array

Gets all the browser/device features' groups

Returns
TypeDescription
array
methodpublicgetBrowser() : string

Get the browser type

Returns
TypeDescription
string
methodpublicgetBrowserVersion() : string

Get the browser version

Returns
TypeDescription
string
methodpublicgetFeature(string $feature) : string | null

Gets the value of the current browser/device feature

Parameters
NameTypeDescription
$featurestring

Feature to search

Returns
TypeDescription
string | null
methodpublicgetGroup(string $group) : array

Gets an array of features associated to a group

Parameters
NameTypeDescription
$groupstring

Group param

Returns
TypeDescription
array
methodpublicgetImageFormatSupport() : array

Retrieve image format support

Returns
TypeDescription
array
methodpublicgetImages() : \the

Returns
TypeDescription
\the$_images
methodpublicgetMaxImageHeight() : int

Get maximum image height supported by this device

Returns
TypeDescription
int
methodpublicgetMaxImageWidth() : int

Get maximum image width supported by this device

Returns
TypeDescription
int
methodpublicgetPhysicalScreenHeight() : int

Get physical screen height of this device

Returns
TypeDescription
int
methodpublicgetPhysicalScreenWidth() : int

Get physical screen width of this device

Returns
TypeDescription
int
methodpublicgetPreferredMarkup() : string

Get preferred markup type

Returns
TypeDescription
string
methodpublicgetType() : string
abstract

Gets the browser type identifier

Returns
TypeDescription
string
methodpublicgetUserAgent() : string

Get the user agent string

Returns
TypeDescription
string
methodpublicgetXhtmlSupportLevel() : int

Get supported X/HTML version

Returns
TypeDescription
int
methodpublichasFeature(string $feature) : bool

Check a feature for the current browser/device.

Parameters
NameTypeDescription
$featurestring

The feature to check.

Returns
TypeDescription
bool
methodpublichasFlashSupport() : bool

Does the device support Flash?

Returns
TypeDescription
bool
methodpublichasPdfSupport() : bool

Does the device support PDF?

Returns
TypeDescription
bool
methodpublichasPhoneNumber() : bool

Does the device have a phone number associated with it?

Returns
TypeDescription
bool
methodpublichttpsSupport() : bool

Does the device support HTTPS?

Returns
TypeDescription
bool
methodpublicserialize() : string

Serialize object

Returns
TypeDescription
string
methodpublicsetBrowser(string $browser) : void

Parameters
NameTypeDescription
$browserstring
methodpublicsetBrowserVersion(string $browserVersion) : void

Parameters
NameTypeDescription
$browserVersionstring
methodpublicsetFeature(string $feature, string $value = false, string $group = '') : \Zend_Http_UserAgent_AbstractDevice

Set a feature for the current browser/device.

Parameters
NameTypeDescription
$featurestring

The feature to set.

$valuestring

(option) feature value.

$groupstring

(option) Group to associate with the feature

Returns
TypeDescription
\Zend_Http_UserAgent_AbstractDevice
methodpublicsetGroup(string $group, string $feature) : \Zend_Http_UserAgent_AbstractDevice

Affects a feature to a group

Parameters
NameTypeDescription
$groupstring

Group name

$featurestring

Feature name

Returns
TypeDescription
\Zend_Http_UserAgent_AbstractDevice
methodpublicsetImages(array $_images) : void

Parameters
NameTypeDescription
$_imagesarray
methodpublicsetUserAgent(string $userAgent) : void

Parameters
NameTypeDescription
$userAgentstring
methodpublicunserialize(string $serialized) : void

Unserialize

Parameters
NameTypeDescription
$serializedstring
Documentation was generated by phpDocumentor 2.2.0 .