Http/UserAgent/Validator.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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Http  
Subpackage
UserAgent  

\Zend_Http_UserAgent_Validator

Package: Zend\Http\UserAgent
Validator browser type matcher
Parent(s)
\Zend_Http_UserAgent_Desktop < \Zend_Http_UserAgent_AbstractDevice
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedarray $_aFeatures = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Http_UserAgent_AbstractDevice::$$_aFeatures  
Inherited_from
\Zend_Http_UserAgent_Desktop::$$_aFeatures  
>VPropertyprotectedarray $_aGroup = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Http_UserAgent_AbstractDevice::$$_aGroup  
Inherited_from
\Zend_Http_UserAgent_Desktop::$$_aGroup  
>VPropertyprotectedstring $_browser = ''
Default value''Details
Type
string
Inherited_from
\Zend_Http_UserAgent_AbstractDevice::$$_browser  
Inherited_from
\Zend_Http_UserAgent_Desktop::$$_browser  
>VPropertyprotectedstring $_browserVersion = ''
Default value''Details
Type
string
Inherited_from
\Zend_Http_UserAgent_AbstractDevice::$$_browserVersion  
Inherited_from
\Zend_Http_UserAgent_Desktop::$$_browserVersion  
>VPropertyprotectedarray $_images = array('jpeg', 'gif', 'png', 'pjpeg', 'x-png', 'bmp')
Default valuearray('jpeg', 'gif', 'png', 'pjpeg', 'x-png', 'bmp')Details
Type
array
Inherited_from
\Zend_Http_UserAgent_AbstractDevice::$$_images  
Inherited_from
\Zend_Http_UserAgent_Desktop::$$_images  
>VPropertyprotectedarray $_uaSignatures = array('htmlvalidator', 'csscheck', 'cynthia', 'htmlparser', 'validator', 'jfouffa', 'jigsaw', 'w3c_validator', 'wdg_validator')
static
User Agent Signatures
Default valuearray('htmlvalidator', 'csscheck', 'cynthia', 'htmlparser', 'validator', 'jfouffa', 'jigsaw', 'w3c_validator', 'wdg_validator')Details
Type
array

Methods

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

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.

Parameters
NameTypeDescription
$userAgentnull | string | array

If array, restores from serialized version

$serverarray
$configarray
methodprotected_defineFeatures() : array | null
Returns
TypeDescription
array | null
methodprotected_getDefaultFeatures() : void
inherited

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

Inherited from: \Zend_Http_UserAgent_AbstractDevice::_getDefaultFeatures()\Zend_Http_UserAgent_Desktop::_getDefaultFeatures()
methodprotected_loadFeaturesAdapter() : array
inherited

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

Inherited from: \Zend_Http_UserAgent_AbstractDevice::_loadFeaturesAdapter()\Zend_Http_UserAgent_Desktop::_loadFeaturesAdapter()
Returns
TypeDescription
array
methodprotected_matchAgentAgainstSignatures(string $userAgent, array $signatures) : bool
staticinherited

Match a user agent string against a list of signatures

Inherited from: \Zend_Http_UserAgent_AbstractDevice::_matchAgentAgainstSignatures()\Zend_Http_UserAgent_Desktop::_matchAgentAgainstSignatures()
Parameters
NameTypeDescription
$userAgentstring
$signaturesarray
Returns
TypeDescription
bool
methodprotected_restoreFromArray(array $spec) : void
Parameters
NameTypeDescription
$specarray
methodpublicextractFromUserAgent(string $userAgent) : array
staticinherited

Extract and sets informations from the User Agent chain

Inherited from: \Zend_Http_UserAgent_AbstractDevice::extractFromUserAgent()\Zend_Http_UserAgent_Desktop::extractFromUserAgent()
Parameters
NameTypeDescription
$userAgentstring

User Agent chain

Returns
TypeDescription
array
methodpublicgetAllFeatures() : array
Returns
TypeDescription
array
methodpublicgetAllGroups() : array
inherited

Gets all the browser/device features' groups

Inherited from: \Zend_Http_UserAgent_AbstractDevice::getAllGroups()\Zend_Http_UserAgent_Desktop::getAllGroups()
Returns
TypeDescription
array
methodpublicgetBrowser() : string
Returns
TypeDescription
string
methodpublicgetBrowserVersion() : string
Returns
TypeDescription
string
methodpublicgetFeature(string $feature) : string | null
inherited

Gets the value of the current browser/device feature

Inherited from: \Zend_Http_UserAgent_AbstractDevice::getFeature()\Zend_Http_UserAgent_Desktop::getFeature()
Parameters
NameTypeDescription
$featurestring

Feature to search

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

Gets an array of features associated to a group

Inherited from: \Zend_Http_UserAgent_AbstractDevice::getGroup()\Zend_Http_UserAgent_Desktop::getGroup()
Parameters
NameTypeDescription
$groupstring

Group param

Returns
TypeDescription
array
methodpublicgetImageFormatSupport() : array
Returns
TypeDescription
array
methodpublicgetImages() : \the
Returns
TypeDescription
\the$_images
methodpublicgetMaxImageHeight() : int
inherited

Get maximum image height supported by this device

Inherited from: \Zend_Http_UserAgent_AbstractDevice::getMaxImageHeight()\Zend_Http_UserAgent_Desktop::getMaxImageHeight()
Returns
TypeDescription
int
methodpublicgetMaxImageWidth() : int
inherited

Get maximum image width supported by this device

Inherited from: \Zend_Http_UserAgent_AbstractDevice::getMaxImageWidth()\Zend_Http_UserAgent_Desktop::getMaxImageWidth()
Returns
TypeDescription
int
methodpublicgetPhysicalScreenHeight() : int
Returns
TypeDescription
int
methodpublicgetPhysicalScreenWidth() : int
Returns
TypeDescription
int
methodpublicgetPreferredMarkup() : string
Returns
TypeDescription
string
methodpublicgetType() : string

Gives the current browser type

Returns
TypeDescription
string
methodpublicgetUserAgent() : string
Returns
TypeDescription
string
methodpublicgetXhtmlSupportLevel() : int
Returns
TypeDescription
int
methodpublichasFeature(string $feature) : bool
inherited

Check a feature for the current browser/device.

Inherited from: \Zend_Http_UserAgent_AbstractDevice::hasFeature()\Zend_Http_UserAgent_Desktop::hasFeature()
Parameters
NameTypeDescription
$featurestring

The feature to check.

Returns
TypeDescription
bool
methodpublichasFlashSupport() : bool
Returns
TypeDescription
bool
methodpublichasPdfSupport() : bool
Returns
TypeDescription
bool
methodpublichasPhoneNumber() : bool
inherited

Does the device have a phone number associated with it?

Inherited from: \Zend_Http_UserAgent_AbstractDevice::hasPhoneNumber()\Zend_Http_UserAgent_Desktop::hasPhoneNumber()
Returns
TypeDescription
bool
methodpublichttpsSupport() : bool
Returns
TypeDescription
bool
methodpublicmatch(string $userAgent, array $server) : bool
static

Comparison of the UserAgent chain and User Agent signatures

Return either an array of browser signature strings, or a boolean.

Parameters
NameTypeDescription
$userAgentstring

User Agent chain

$serverarray

$_SERVER like param

Returns
TypeDescription
bool
methodpublicserialize() : string
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
inherited

Set a feature for the current browser/device.

Inherited from: \Zend_Http_UserAgent_AbstractDevice::setFeature()\Zend_Http_UserAgent_Desktop::setFeature()
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
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
Parameters
NameTypeDescription
$serializedstring
Documentation was generated by phpDocumentor 2.0.0a12.