PHP Class Swift_KeyCache_DiskKeyCache, Halite

Author: Chris Corbyn
Inheritance: implements Swift_KeyCache
Show file Open project: HaliteChallenge/Halite

Public Methods

Method Description
__construct ( Swift_KeyCache_KeyCacheInputStream $stream, string $path ) Create a new DiskKeyCache with the given $stream for cloning to make InputByteStreams, and the given $path to save to.
__destruct ( ) Destructor.
clearAll ( string $nsKey ) Clear all data in the namespace $nsKey if it exists.
clearKey ( string $nsKey, string $itemKey ) Clear data for $itemKey in the namespace $nsKey if it exists.
exportToByteStream ( string $nsKey, string $itemKey, Swift_InputByteStream $is ) Get data back out of the cache as a ByteStream.
getInputByteStream ( string $nsKey, string $itemKey, Swift_InputByteStream $writeThrough = null ) : Swift_InputByteStream Provides a ByteStream which when written to, writes data to $itemKey.
getString ( string $nsKey, string $itemKey ) : string Get data back out of the cache as a string.
hasKey ( string $nsKey, string $itemKey ) : boolean Check if the given $itemKey exists in the namespace $nsKey.
importFromByteStream ( string $nsKey, string $itemKey, Swift_OutputByteStream $os, integer $mode ) Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
setString ( string $nsKey, string $itemKey, string $string, integer $mode ) Set a string into the cache under $itemKey for the namespace $nsKey.

Private Methods

Method Description
_freeHandle ( $nsKey, $itemKey )
_getHandle ( string $nsKey, string $itemKey, integer $position ) : resource Get a file handle on the cache item.
_prepareCache ( string $nsKey ) Initialize the namespace of $nsKey if needed.

Method Details

__construct() public method

Create a new DiskKeyCache with the given $stream for cloning to make InputByteStreams, and the given $path to save to.
public __construct ( Swift_KeyCache_KeyCacheInputStream $stream, string $path )
$stream Swift_KeyCache_KeyCacheInputStream
$path string to save to

__destruct() public method

Destructor.
public __destruct ( )

clearAll() public method

Clear all data in the namespace $nsKey if it exists.
public clearAll ( string $nsKey )
$nsKey string

clearKey() public method

Clear data for $itemKey in the namespace $nsKey if it exists.
public clearKey ( string $nsKey, string $itemKey )
$nsKey string
$itemKey string

exportToByteStream() public method

Get data back out of the cache as a ByteStream.
public exportToByteStream ( string $nsKey, string $itemKey, Swift_InputByteStream $is )
$nsKey string
$itemKey string
$is Swift_InputByteStream to write the data to

getInputByteStream() public method

NOTE: The stream will always write in append mode.
public getInputByteStream ( string $nsKey, string $itemKey, Swift_InputByteStream $writeThrough = null ) : Swift_InputByteStream
$nsKey string
$itemKey string
$writeThrough Swift_InputByteStream
return Swift_InputByteStream

getString() public method

Get data back out of the cache as a string.
public getString ( string $nsKey, string $itemKey ) : string
$nsKey string
$itemKey string
return string

hasKey() public method

Check if the given $itemKey exists in the namespace $nsKey.
public hasKey ( string $nsKey, string $itemKey ) : boolean
$nsKey string
$itemKey string
return boolean

importFromByteStream() public method

Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
public importFromByteStream ( string $nsKey, string $itemKey, Swift_OutputByteStream $os, integer $mode )
$nsKey string
$itemKey string
$os Swift_OutputByteStream
$mode integer

setString() public method

Set a string into the cache under $itemKey for the namespace $nsKey.
public setString ( string $nsKey, string $itemKey, string $string, integer $mode )
$nsKey string
$itemKey string
$string string
$mode integer