PHP Class BrowscapPHP\Browscap

Author: Jonathan Stoppani ([email protected])
Author: Vítor Brandão ([email protected])
Author: Mikołaj Misiurewicz ([email protected])
Author: Christoph Ziegenberg ([email protected])
Author: Thomas Müller ([email protected])
Afficher le fichier Open project: browscap/browscap-php Class Usage Examples

Méthodes publiques

Méthode Description
getBrowser ( string $userAgent = null ) : stdClass parses the given user agent to get the information about the browser
getCache ( ) : BrowscapPHP\Cache\BrowscapCacheInterface Gets a cache instance
getFormatter ( ) : BrowscapPHP\Formatter\FormatterInterface
getLogger ( ) : Psr\Log\LoggerInterface returns a logger instance
getParser ( ) : BrowscapPHP\Parser\ParserInterface returns an instance of the used parser class
setCache ( BrowscapPHP\Cache\BrowscapCacheInterface | WurflCache\Adapter\AdapterInterface $cache ) : Browscap Sets a cache instance
setFormatter ( BrowscapPHP\Formatter\FormatterInterface $formatter ) : Browscap Set theformatter instance to use for the getBrowser() result
setLogger ( Psr\Log\LoggerInterface $logger ) : Browscap Sets a logger instance
setParser ( BrowscapPHP\Parser\ParserInterface $parser ) : Browscap Sets the parser instance to use

Method Details

getBrowser() public méthode

if no user agent is given, it uses {@see \BrowscapPHP\Helper\Support} to get it
public getBrowser ( string $userAgent = null ) : stdClass
$userAgent string the user agent string
Résultat stdClass the object containing the browsers details. Array if $return_array is set to true.

getCache() public méthode

Gets a cache instance
public getCache ( ) : BrowscapPHP\Cache\BrowscapCacheInterface
Résultat BrowscapPHP\Cache\BrowscapCacheInterface

getFormatter() public méthode

public getFormatter ( ) : BrowscapPHP\Formatter\FormatterInterface
Résultat BrowscapPHP\Formatter\FormatterInterface

getLogger() public méthode

returns a logger instance
public getLogger ( ) : Psr\Log\LoggerInterface
Résultat Psr\Log\LoggerInterface

getParser() public méthode

returns an instance of the used parser class
public getParser ( ) : BrowscapPHP\Parser\ParserInterface
Résultat BrowscapPHP\Parser\ParserInterface

setCache() public méthode

Sets a cache instance
public setCache ( BrowscapPHP\Cache\BrowscapCacheInterface | WurflCache\Adapter\AdapterInterface $cache ) : Browscap
$cache BrowscapPHP\Cache\BrowscapCacheInterface | WurflCache\Adapter\AdapterInterface
Résultat Browscap

setFormatter() public méthode

Set theformatter instance to use for the getBrowser() result
public setFormatter ( BrowscapPHP\Formatter\FormatterInterface $formatter ) : Browscap
$formatter BrowscapPHP\Formatter\FormatterInterface
Résultat Browscap

setLogger() public méthode

Sets a logger instance
public setLogger ( Psr\Log\LoggerInterface $logger ) : Browscap
$logger Psr\Log\LoggerInterface
Résultat Browscap

setParser() public méthode

Sets the parser instance to use
public setParser ( BrowscapPHP\Parser\ParserInterface $parser ) : Browscap
$parser BrowscapPHP\Parser\ParserInterface
Résultat Browscap