\Swift_KeyCache_DiskKeyCache
A KeyCache which streams to and from disk.
- Author: Chris Corbyn
Synopsis
class Swift_KeyCache_DiskKeyCache
implements
Swift_KeyCache
{
- // constants
- const POSITION_START = 0;
- const POSITION_END = 1;
- const POSITION_CURRENT = 2;
- // members
- private Swift_KeyCache_KeyCacheInputStream $_stream;
- private string $_path;
- private array $_keys;
- private boolean $_quotes;
- // methods
- public void __construct()
- public void setString()
- public void importFromByteStream()
- public Swift_InputByteStream getInputByteStream()
- public string getString()
- public void exportToByteStream()
- public boolean hasKey()
- public void clearKey()
- public void clearAll()
- private void _prepareCache()
- private resource _getHandle()
- private void _freeHandle()
- public void __destruct()
Hierarchy
Implements
Constants
Name | Value |
---|---|
POSITION_START | 0 |
POSITION_END | 1 |
POSITION_CURRENT | 2 |
MODE_WRITE | 1 |
MODE_APPEND | 2 |
Members
private
- $_keys
—
array
Stored keys. - $_path
—
string
A path to write to. - $_quotes
—
boolean
Will be true if magic_quotes_runtime is turned on. - $_stream
—
Swift_KeyCache_KeyCacheInputStream
An InputStream for cloning.
Methods
private
- _freeHandle()
- _getHandle() — Get a file handle on the cache item.
- _prepareCache() — Initialize the namespace of $nsKey if needed.
public
- __construct() — Create a new DiskKeyCache with the given $stream for cloning to make InputByteStreams, and the given $path to save to.
- __destruct() — Destructor.
- clearAll() — Clear all data in the namespace $nsKey if it exists.
- clearKey() — Clear data for $itemKey in the namespace $nsKey if it exists.
- exportToByteStream() — Get data back out of the cache as a ByteStream.
- getInputByteStream() — Provides a ByteStream which when written to, writes data to $itemKey.
- getString() — Get data back out of the cache as a string.
- hasKey() — Check if the given $itemKey exists in the namespace $nsKey.
- importFromByteStream() — Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
- setString() — Set a string into the cache under $itemKey for the namespace $nsKey.