Avail feature updated
[ninja.git] / application / vendor / swiftmailer / classes / Swift / KeyCache.php
blobb942663a522b5afca4dbae048b577d92d33d4579
1 <?php
3 /*
4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
11 //@require 'Swift/InputByteStream.php';
12 //@require 'Swift/OutputByteStream.php';
14 /**
15 * Provides a mechanism for storing data using two keys.
16 * @package Swift
17 * @subpackage KeyCache
18 * @author Chris Corbyn
20 interface Swift_KeyCache
23 /** Mode for replacing existing cached data */
24 const MODE_WRITE = 1;
26 /** Mode for appending data to the end of existing cached data */
27 const MODE_APPEND = 2;
29 /**
30 * Set a string into the cache under $itemKey for the namespace $nsKey.
31 * @param string $nsKey
32 * @param string $itemKey
33 * @param string $string
34 * @param int $mode
35 * @see MODE_WRITE, MODE_APPEND
37 public function setString($nsKey, $itemKey, $string, $mode);
39 /**
40 * Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
41 * @param string $nsKey
42 * @param string $itemKey
43 * @param Swift_OutputByteStream $os
44 * @param int $mode
45 * @see MODE_WRITE, MODE_APPEND
47 public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os,
48 $mode);
50 /**
51 * Provides a ByteStream which when written to, writes data to $itemKey.
52 * NOTE: The stream will always write in append mode.
53 * If the optional third parameter is passed all writes will go through $is.
54 * @param string $nsKey
55 * @param string $itemKey
56 * @param Swift_InputByteStream $is, optional
57 * @return Swift_InputByteStream
59 public function getInputByteStream($nsKey, $itemKey,
60 Swift_InputByteStream $is = null);
62 /**
63 * Get data back out of the cache as a string.
64 * @param string $nsKey
65 * @param string $itemKey
66 * @return string
68 public function getString($nsKey, $itemKey);
70 /**
71 * Get data back out of the cache as a ByteStream.
72 * @param string $nsKey
73 * @param string $itemKey
74 * @param Swift_InputByteStream $is to write the data to
76 public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is);
78 /**
79 * Check if the given $itemKey exists in the namespace $nsKey.
80 * @param string $nsKey
81 * @param string $itemKey
82 * @return boolean
84 public function hasKey($nsKey, $itemKey);
86 /**
87 * Clear data for $itemKey in the namespace $nsKey if it exists.
88 * @param string $nsKey
89 * @param string $itemKey
91 public function clearKey($nsKey, $itemKey);
93 /**
94 * Clear all data in the namespace $nsKey if it exists.
95 * @param string $nsKey
97 public function clearAll($nsKey);