XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
Swift_KeyCache_DiskKeyCache Class Reference
Inheritance diagram for Swift_KeyCache_DiskKeyCache:
Inheritance graph

Public Member Functions

 __construct (Swift_KeyCache_KeyCacheInputStream $stream, $path)
 
 __destruct ()
 
 clearAll ($nsKey)
 
 clearKey ($nsKey, $itemKey)
 
 exportToByteStream ($nsKey, $itemKey, Swift_InputByteStream $is)
 
 getInputByteStream ($nsKey, $itemKey, Swift_InputByteStream $writeThrough=null)
 
 getString ($nsKey, $itemKey)
 
 hasKey ($nsKey, $itemKey)
 
 importFromByteStream ($nsKey, $itemKey, Swift_OutputByteStream $os, $mode)
 
 setString ($nsKey, $itemKey, $string, $mode)
 

Public Attributes

const POSITION_END = 1
 
const POSITION_START = 0
 
- Public Attributes inherited from Swift_KeyCache
const MODE_APPEND = 2
 
const MODE_WRITE = 1
 

Private Member Functions

 _getHandle ($nsKey, $itemKey, $position)
 
 _prepareCache ($nsKey)
 

Private Attributes

 $_keys = array()
 
 $_path
 
 $_quotes = false
 
 $_stream
 

Detailed Description

Definition at line 24 of file DiskKeyCache.php.

Constructor & Destructor Documentation

Swift_KeyCache_DiskKeyCache::__construct ( Swift_KeyCache_KeyCacheInputStream  $stream,
  $path 
)

Create a new DiskKeyCache with the given $stream for cloning to make InputByteStreams, and the given $path to save to.

Parameters
Swift_KeyCache_KeyCacheInputStream$stream
string$pathto save to

Definition at line 67 of file DiskKeyCache.php.

References $path.

Swift_KeyCache_DiskKeyCache::__destruct ( )

Destructor.

Definition at line 308 of file DiskKeyCache.php.

References clearAll().

Here is the call graph for this function:

Member Function Documentation

Swift_KeyCache_DiskKeyCache::_getHandle (   $nsKey,
  $itemKey,
  $position 
)
private

Get a file handle on the cache item.

Parameters
string$nsKey
string$itemKey
int$position
Returns
resource private

Definition at line 287 of file DiskKeyCache.php.

Referenced by clearKey(), exportToByteStream(), getString(), importFromByteStream(), and setString().

Here is the caller graph for this function:

Swift_KeyCache_DiskKeyCache::_prepareCache (   $nsKey)
private

Initialize the namespace of $nsKey if needed.

Parameters
string$nsKeyprivate

Definition at line 266 of file DiskKeyCache.php.

Referenced by getString(), importFromByteStream(), and setString().

Here is the caller graph for this function:

Swift_KeyCache_DiskKeyCache::clearAll (   $nsKey)

Clear all data in the namespace $nsKey if it exists.

Parameters
string$nsKey

Implements Swift_KeyCache.

Definition at line 246 of file DiskKeyCache.php.

References clearKey().

Referenced by __destruct().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_KeyCache_DiskKeyCache::clearKey (   $nsKey,
  $itemKey 
)

Clear data for $itemKey in the namespace $nsKey if it exists.

Parameters
string$nsKey
string$itemKey

Implements Swift_KeyCache.

Definition at line 231 of file DiskKeyCache.php.

References _getHandle(), and hasKey().

Referenced by clearAll().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_KeyCache_DiskKeyCache::exportToByteStream (   $nsKey,
  $itemKey,
Swift_InputByteStream  $is 
)

Get data back out of the cache as a ByteStream.

Parameters
string$nsKey
string$itemKey
Swift_InputByteStream$isto write the data to

Implements Swift_KeyCache.

Definition at line 195 of file DiskKeyCache.php.

References _getHandle(), hasKey(), and Swift_InputByteStream\write().

Here is the call graph for this function:

Swift_KeyCache_DiskKeyCache::getInputByteStream (   $nsKey,
  $itemKey,
Swift_InputByteStream  $writeThrough = null 
)

Provides a ByteStream which when written to, writes data to $itemKey. NOTE: The stream will always write in append mode.

Parameters
string$nsKey
string$itemKey
Returns
Swift_InputByteStream

Implements Swift_KeyCache.

Definition at line 145 of file DiskKeyCache.php.

References $_stream.

Swift_KeyCache_DiskKeyCache::getString (   $nsKey,
  $itemKey 
)

Get data back out of the cache as a string.

Parameters
string$nsKey
string$itemKey
Returns
string
Exceptions
Swift_IoException

Implements Swift_KeyCache.

Definition at line 166 of file DiskKeyCache.php.

References $str, _getHandle(), _prepareCache(), and hasKey().

Here is the call graph for this function:

Swift_KeyCache_DiskKeyCache::hasKey (   $nsKey,
  $itemKey 
)

Check if the given $itemKey exists in the namespace $nsKey.

Parameters
string$nsKey
string$itemKey
Returns
boolean

Implements Swift_KeyCache.

Definition at line 221 of file DiskKeyCache.php.

Referenced by clearKey(), exportToByteStream(), and getString().

Here is the caller graph for this function:

Swift_KeyCache_DiskKeyCache::importFromByteStream (   $nsKey,
  $itemKey,
Swift_OutputByteStream  $os,
  $mode 
)

Set a ByteStream into the cache under $itemKey for the namespace $nsKey.

Parameters
string$nsKey
string$itemKey
Swift_OutputByteStream$os
int$mode
See Also
MODE_WRITE, MODE_APPEND
Exceptions
Swift_IoException

Implements Swift_KeyCache.

Definition at line 113 of file DiskKeyCache.php.

References _getHandle(), _prepareCache(), and Swift_OutputByteStream\read().

Here is the call graph for this function:

Swift_KeyCache_DiskKeyCache::setString (   $nsKey,
  $itemKey,
  $string,
  $mode 
)

Set a string into the cache under $itemKey for the namespace $nsKey.

Parameters
string$nsKey
string$itemKey
string$string
int$mode
Exceptions
Swift_IoException
See Also
MODE_WRITE, MODE_APPEND

Implements Swift_KeyCache.

Definition at line 83 of file DiskKeyCache.php.

References _getHandle(), and _prepareCache().

Here is the call graph for this function:

Member Data Documentation

Swift_KeyCache_DiskKeyCache::$_keys = array()
private

Definition at line 52 of file DiskKeyCache.php.

Swift_KeyCache_DiskKeyCache::$_path
private

Definition at line 45 of file DiskKeyCache.php.

Swift_KeyCache_DiskKeyCache::$_quotes = false
private

Definition at line 59 of file DiskKeyCache.php.

Swift_KeyCache_DiskKeyCache::$_stream
private

Definition at line 38 of file DiskKeyCache.php.

Referenced by getInputByteStream().

const Swift_KeyCache_DiskKeyCache::POSITION_END = 1

Signal to place pointer at end of file

Definition at line 31 of file DiskKeyCache.php.

const Swift_KeyCache_DiskKeyCache::POSITION_START = 0

Signal to place pointer at start of file

Definition at line 28 of file DiskKeyCache.php.


The documentation for this class was generated from the following file: