PHP Interface BrowscapPHP\Cache\BrowscapCacheInterface

Show file Open project: browscap/browscap-php Interface Usage Examples

Public Methods

Method Description
__construct ( WurflCache\Adapter\AdapterInterface $adapter ) Constructor class, checks for the existence of (and loads) the cache and if needed updated the definitions
flush ( ) : boolean Flush the whole storage
getItem ( string $cacheId, boolean $withVersion = true, boolean &$success = null ) : mixed Get an item.
getReleaseDate ( ) : string Gets the release date of the Browscap data
getType ( ) : string Gets the type of the Browscap data
getVersion ( ) : integer Gets the version of the Browscap data
hasItem ( string $cacheId, boolean $withVersion = true ) : boolean Test if an item exists.
removeItem ( string $cacheId, boolean $withVersion = true ) : boolean Remove an item.
setItem ( string $cacheId, mixed $content, boolean $withVersion = true ) : boolean save the content into an php file

Method Details

__construct() public method

Constructor class, checks for the existence of (and loads) the cache and if needed updated the definitions
public __construct ( WurflCache\Adapter\AdapterInterface $adapter )
$adapter WurflCache\Adapter\AdapterInterface

flush() public method

Flush the whole storage
public flush ( ) : boolean
return boolean

getItem() public method

Get an item.
public getItem ( string $cacheId, boolean $withVersion = true, boolean &$success = null ) : mixed
$cacheId string
$withVersion boolean
$success boolean
return mixed Data on success, null on failure

getReleaseDate() public method

Gets the release date of the Browscap data
public getReleaseDate ( ) : string
return string

getType() public method

Gets the type of the Browscap data
public getType ( ) : string
return string

getVersion() public method

Gets the version of the Browscap data
public getVersion ( ) : integer
return integer

hasItem() public method

Test if an item exists.
public hasItem ( string $cacheId, boolean $withVersion = true ) : boolean
$cacheId string
$withVersion boolean
return boolean

removeItem() public method

Remove an item.
public removeItem ( string $cacheId, boolean $withVersion = true ) : boolean
$cacheId string
$withVersion boolean
return boolean

setItem() public method

save the content into an php file
public setItem ( string $cacheId, mixed $content, boolean $withVersion = true ) : boolean
$cacheId string The cache id
$content mixed The content to store
$withVersion boolean
return boolean whether the file was correctly written to the disk