1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: *
6: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
7: *
8: * For the full copyright and license information, please view
9: * the file license.txt that was distributed with this source code.
10: */
11:
12: namespace Nette\Caching;
13:
14: use Nette;
15:
16:
17: /**
18: * Cache storage.
19: *
20: * @author David Grudl
21: */
22: interface IStorage
23: {
24:
25: /**
26: * Read from cache.
27: * @param string key
28: * @return mixed|NULL
29: */
30: function read($key);
31:
32: /**
33: * Prevents item reading and writing. Lock is released by write() or remove().
34: * @param string key
35: * @return void
36: */
37: function lock($key);
38:
39: /**
40: * Writes item into the cache.
41: * @param string key
42: * @param mixed data
43: * @param array dependencies
44: * @return void
45: */
46: function write($key, $data, array $dependencies);
47:
48: /**
49: * Removes item from the cache.
50: * @param string key
51: * @return void
52: */
53: function remove($key);
54:
55: /**
56: * Removes items from the cache by conditions.
57: * @param array conditions
58: * @return void
59: */
60: function clean(array $conditions);
61:
62: }
63: