PHP 클래스 DeviceDetector\Parser\ParserAbstract

파일 보기 프로젝트 열기: piwik/device-detector 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cache DeviceDetector\Cache\Cache | Doctrine\Common\Cache\CacheProvider
$fixtureFile string Holds the path to the yml file containing regexes
$globalMethods array Holds an array with method that should be available global
$maxMinorParts integer Indicates how deep versioning will be detected if $maxMinorParts is 0 only the major version will be returned
$parserName string Holds the internal name of the parser Used for caching
$regexList array Holds an array with regexes to parse, if already loaded
$userAgent string Holds the user agent the should be parsed
$yamlParser DeviceDetector\Yaml\Parser

공개 메소드들

메소드 설명
__construct ( $ua = '' )
getCache ( ) : DeviceDetector\Cache\Cache | CacheProvider Returns Cache object
getName ( ) : string Returns the internal name of the parser
getYamlParser ( ) : DeviceDetector\Yaml\Parser Returns Cache object
parse ( )
setCache ( DeviceDetector\Cache\Cache | CacheProvider $cache ) Sets the Cache class
setUserAgent ( string $ua ) Sets the user agent to parse
setVersionTruncation ( integer | null $type ) Set how DeviceDetector should return versions
setYamlParser ( $yamlParser ) Sets the Cache class

보호된 메소드들

메소드 설명
buildByMatch ( string $item, array $matches ) : string
buildVersion ( $versionString, $matches ) : mixed | string Builds the version with the given $versionString and $matches
getRegexes ( ) : array Returns the result of the parsed yml file defined in $fixtureFile
getRegexesDirectory ( ) : string
matchUserAgent ( $regex ) : array | boolean Matches the useragent against the given regex
preMatchOverall ( ) : boolean Tests the useragent against a combination of all regexes

메소드 상세

__construct() 공개 메소드

public __construct ( $ua = '' )

buildByMatch() 보호된 메소드

protected buildByMatch ( string $item, array $matches ) : string
$item string
$matches array
리턴 string type

buildVersion() 보호된 메소드

Example: $versionString = 'v$2' $matches = array('version_1_0_1', '1_0_1') return value would be v1.0.1
protected buildVersion ( $versionString, $matches ) : mixed | string
$versionString
$matches
리턴 mixed | string

getCache() 공개 메소드

Returns Cache object
public getCache ( ) : DeviceDetector\Cache\Cache | CacheProvider
리턴 DeviceDetector\Cache\Cache | Doctrine\Common\Cache\CacheProvider

getName() 공개 메소드

Returns the internal name of the parser
public getName ( ) : string
리턴 string

getRegexes() 보호된 메소드

Returns the result of the parsed yml file defined in $fixtureFile
protected getRegexes ( ) : array
리턴 array

getRegexesDirectory() 보호된 메소드

protected getRegexesDirectory ( ) : string
리턴 string

getYamlParser() 공개 메소드

Returns Cache object
public getYamlParser ( ) : DeviceDetector\Yaml\Parser
리턴 DeviceDetector\Yaml\Parser

matchUserAgent() 보호된 메소드

Matches the useragent against the given regex
protected matchUserAgent ( $regex ) : array | boolean
$regex
리턴 array | boolean

parse() 추상적인 공개 메소드

abstract public parse ( )

preMatchOverall() 보호된 메소드

All regexes returned by getRegexes() will be reversed and concated with '|' Afterwards the big regex will be tested against the user agent Method can be used to speed up detections by making a big check before doing checks for every single regex
protected preMatchOverall ( ) : boolean
리턴 boolean

setCache() 공개 메소드

Sets the Cache class
public setCache ( DeviceDetector\Cache\Cache | CacheProvider $cache )
$cache DeviceDetector\Cache\Cache | Doctrine\Common\Cache\CacheProvider

setUserAgent() 공개 메소드

Sets the user agent to parse
public setUserAgent ( string $ua )
$ua string user agent

setVersionTruncation() 공개 정적인 메소드

Set how DeviceDetector should return versions
public static setVersionTruncation ( integer | null $type )
$type integer | null Any of the VERSION_TRUNCATION_* constants

setYamlParser() 공개 메소드

Sets the Cache class
public setYamlParser ( $yamlParser )

프로퍼티 상세

$cache 보호되어 있는 프로퍼티

protected Cache,DeviceDetector\Cache|CacheProvider,Doctrine\Common\Cache $cache
리턴 DeviceDetector\Cache\Cache | Doctrine\Common\Cache\CacheProvider

$fixtureFile 보호되어 있는 프로퍼티

Holds the path to the yml file containing regexes
protected string $fixtureFile
리턴 string

$globalMethods 보호되어 있는 프로퍼티

Holds an array with method that should be available global
protected array $globalMethods
리턴 array

$maxMinorParts 보호되어 있는 정적으로 프로퍼티

Indicates how deep versioning will be detected if $maxMinorParts is 0 only the major version will be returned
protected static int $maxMinorParts
리턴 integer

$parserName 보호되어 있는 프로퍼티

Holds the internal name of the parser Used for caching
protected string $parserName
리턴 string

$regexList 보호되어 있는 프로퍼티

Holds an array with regexes to parse, if already loaded
protected array $regexList
리턴 array

$userAgent 보호되어 있는 프로퍼티

Holds the user agent the should be parsed
protected string $userAgent
리턴 string

$yamlParser 보호되어 있는 프로퍼티

protected Parser,DeviceDetector\Yaml $yamlParser
리턴 DeviceDetector\Yaml\Parser