PHP 클래스 BrowscapPHP\Parser\Helper\GetPattern

저자: Christoph Ziegenberg ([email protected])
저자: Thomas Müller ([email protected])
상속: implements BrowscapPHP\Parser\Helper\GetPatternInterface
파일 보기 프로젝트 열기: browscap/browscap-php 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( BrowscapPHP\Cache\BrowscapCacheInterface $cache, Psr\Log\LoggerInterface $logger ) class contructor
getPatterns ( string $userAgent ) : Generator Gets some possible patterns that have to be matched against the user agent. With the given user agent string, we can optimize the search for potential patterns: - We check the first characters of the user agent (or better: a hash, generated from it) - We compare the length of the pattern with the length of the user agent (the pattern cannot be longer than the user agent!)

메소드 상세

__construct() 공개 메소드

class contructor
public __construct ( BrowscapPHP\Cache\BrowscapCacheInterface $cache, Psr\Log\LoggerInterface $logger )
$cache BrowscapPHP\Cache\BrowscapCacheInterface
$logger Psr\Log\LoggerInterface

getPatterns() 공개 메소드

Gets some possible patterns that have to be matched against the user agent. With the given user agent string, we can optimize the search for potential patterns: - We check the first characters of the user agent (or better: a hash, generated from it) - We compare the length of the pattern with the length of the user agent (the pattern cannot be longer than the user agent!)
public getPatterns ( string $userAgent ) : Generator
$userAgent string
리턴 Generator