PHP Класс BrowscapPHP\BrowscapUpdater

Автор: Jonathan Stoppani ([email protected])
Автор: Vítor Brandão ([email protected])
Автор: Mikołaj Misiurewicz ([email protected])
Автор: Christoph Ziegenberg ([email protected])
Автор: Thomas Müller ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
checkUpdate ( ) : integer | null checks if an update on a remote location for the local file or the cache
convertFile ( string $iniFile ) reads and parses an ini file and writes the results into the cache
convertString ( string $iniString ) reads and parses an ini string and writes the results into the cache
fetch ( string $file, string $remoteFile = IniLoader::PHP_INI ) fetches a remote file and stores it into a local folder
getCache ( ) : BrowscapPHP\Cache\BrowscapCacheInterface Gets a cache instance
getClient ( ) : Client
getLogger ( ) : Psr\Log\LoggerInterface returns a logger instance
setCache ( BrowscapPHP\Cache\BrowscapCacheInterface | WurflCache\Adapter\AdapterInterface $cache ) : BrowscapUpdater Sets a cache instance
setClient ( Client $client )
setLogger ( Psr\Log\LoggerInterface $logger ) : BrowscapUpdater Sets a logger instance
update ( string $remoteFile = IniLoader::PHP_INI ) fetches a remote file, parses it and writes the result into the cache

Приватные методы

Метод Описание
sanitizeContent ( string $content ) : mixed
storeContent ( Converter $converter, string $content, integer | null $cachedVersion ) reads and parses an ini string and writes the results into the cache

Описание методов

checkUpdate() публичный Метод

checks if an update on a remote location for the local file or the cache
public checkUpdate ( ) : integer | null
Результат integer | null The actual cached version if a newer version is available, null otherwise

convertFile() публичный Метод

reads and parses an ini file and writes the results into the cache
public convertFile ( string $iniFile )
$iniFile string

convertString() публичный Метод

reads and parses an ini string and writes the results into the cache
public convertString ( string $iniString )
$iniString string

fetch() публичный Метод

fetches a remote file and stores it into a local folder
public fetch ( string $file, string $remoteFile = IniLoader::PHP_INI )
$file string The name of the file where to store the remote content
$remoteFile string The code for the remote file to load

getCache() публичный Метод

Gets a cache instance
public getCache ( ) : BrowscapPHP\Cache\BrowscapCacheInterface
Результат BrowscapPHP\Cache\BrowscapCacheInterface

getClient() публичный Метод

public getClient ( ) : Client
Результат GuzzleHttp\Client

getLogger() публичный Метод

returns a logger instance
public getLogger ( ) : Psr\Log\LoggerInterface
Результат Psr\Log\LoggerInterface

setCache() публичный Метод

Sets a cache instance
public setCache ( BrowscapPHP\Cache\BrowscapCacheInterface | WurflCache\Adapter\AdapterInterface $cache ) : BrowscapUpdater
$cache BrowscapPHP\Cache\BrowscapCacheInterface | WurflCache\Adapter\AdapterInterface
Результат BrowscapUpdater

setClient() публичный Метод

public setClient ( Client $client )
$client GuzzleHttp\Client

setLogger() публичный Метод

Sets a logger instance
public setLogger ( Psr\Log\LoggerInterface $logger ) : BrowscapUpdater
$logger Psr\Log\LoggerInterface
Результат BrowscapUpdater

update() публичный Метод

if the local stored information are in the same version as the remote data no actions are taken
public update ( string $remoteFile = IniLoader::PHP_INI )
$remoteFile string The code for the remote file to load