TYPO3  7.6
Public Member Functions | Public Attributes | List of all members
Swift_KeyCache Interface Reference
Inheritance diagram for Swift_KeyCache:
Swift_KeyCache_ArrayKeyCache Swift_KeyCache_DiskKeyCache Swift_KeyCache_NullKeyCache

Public Member Functions

 setString ($nsKey, $itemKey, $string, $mode)
 
 importFromByteStream ($nsKey, $itemKey, Swift_OutputByteStream $os, $mode)
 
 getInputByteStream ($nsKey, $itemKey, Swift_InputByteStream $is=null)
 
 getString ($nsKey, $itemKey)
 
 exportToByteStream ($nsKey, $itemKey, Swift_InputByteStream $is)
 
 hasKey ($nsKey, $itemKey)
 
 clearKey ($nsKey, $itemKey)
 
 clearAll ($nsKey)
 

Public Attributes

const MODE_WRITE = 1
 
const MODE_APPEND = 2
 

Detailed Description

Provides a mechanism for storing data using two keys.

Author
Chris Corbyn

Definition at line 16 of file KeyCache.php.

Member Function Documentation

clearAll (   $nsKey)

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

Parameters
string$nsKey

Implemented in Swift_KeyCache_DiskKeyCache, Swift_KeyCache_ArrayKeyCache, and Swift_KeyCache_NullKeyCache.

clearKey (   $nsKey,
  $itemKey 
)

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

Parameters
string$nsKey
string$itemKey

Implemented in Swift_KeyCache_DiskKeyCache, Swift_KeyCache_ArrayKeyCache, and Swift_KeyCache_NullKeyCache.

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

Get data back out of the cache as a ByteStream.

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

Implemented in Swift_KeyCache_DiskKeyCache, Swift_KeyCache_ArrayKeyCache, and Swift_KeyCache_NullKeyCache.

getInputByteStream (   $nsKey,
  $itemKey,
Swift_InputByteStream  $is = null 
)

Provides a ByteStream which when written to, writes data to $itemKey.

NOTE: The stream will always write in append mode. If the optional third parameter is passed all writes will go through $is.

Parameters
string$nsKey
string$itemKey
Swift_InputByteStream$isoptional input stream
Returns
Swift_InputByteStream

Implemented in Swift_KeyCache_DiskKeyCache, Swift_KeyCache_ArrayKeyCache, and Swift_KeyCache_NullKeyCache.

getString (   $nsKey,
  $itemKey 
)

Get data back out of the cache as a string.

Parameters
string$nsKey
string$itemKey
Returns
string

Implemented in Swift_KeyCache_DiskKeyCache, Swift_KeyCache_ArrayKeyCache, and Swift_KeyCache_NullKeyCache.

hasKey (   $nsKey,
  $itemKey 
)

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

Parameters
string$nsKey
string$itemKey
Returns
bool

Implemented in Swift_KeyCache_DiskKeyCache, Swift_KeyCache_ArrayKeyCache, and Swift_KeyCache_NullKeyCache.

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

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

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

Implemented in Swift_KeyCache_DiskKeyCache, Swift_KeyCache_ArrayKeyCache, and Swift_KeyCache_NullKeyCache.

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

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

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

Implemented in Swift_KeyCache_DiskKeyCache, Swift_KeyCache_ArrayKeyCache, and Swift_KeyCache_NullKeyCache.

Member Data Documentation

const MODE_APPEND = 2

Mode for appending data to the end of existing cached data

Definition at line 22 of file KeyCache.php.

Referenced by Swift_KeyCache_SimpleKeyCacheInputStream\write().

const MODE_WRITE = 1

Mode for replacing existing cached data

Definition at line 19 of file KeyCache.php.

Referenced by Swift_Mime_SimpleMimeEntity\_bodyToString().