| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* Defines the methods that all implementing classes MUST have. Covers CRUD (create, read, update,
|
|
|
4 |
* delete) methods, as well as others that are used in the base <CacheCore> class.
|
|
|
5 |
*
|
|
|
6 |
* @version 2009.03.22
|
|
|
7 |
* @copyright 2006-2010 Ryan Parman
|
|
|
8 |
* @copyright 2006-2010 Foleeo, Inc.
|
|
|
9 |
* @copyright 2008-2010 Contributors
|
|
|
10 |
* @license http://opensource.org/licenses/bsd-license.php Simplified BSD License
|
|
|
11 |
* @link http://github.com/skyzyx/cachecore CacheCore
|
|
|
12 |
* @link http://getcloudfusion.com CloudFusion
|
|
|
13 |
*/
|
|
|
14 |
interface ICacheCore
|
|
|
15 |
{
|
|
|
16 |
/**
|
|
|
17 |
* Creates a new cache.
|
|
|
18 |
*
|
|
|
19 |
* @param mixed $data (Required) The data to cache.
|
|
|
20 |
* @return boolean Whether the operation was successful.
|
|
|
21 |
*/
|
|
|
22 |
public function create($data);
|
|
|
23 |
|
|
|
24 |
/**
|
|
|
25 |
* Reads a cache.
|
|
|
26 |
*
|
|
|
27 |
* @return mixed Either the content of the cache object, or boolean `false`.
|
|
|
28 |
*/
|
|
|
29 |
public function read();
|
|
|
30 |
|
|
|
31 |
/**
|
|
|
32 |
* Updates an existing cache.
|
|
|
33 |
*
|
|
|
34 |
* @param mixed $data (Required) The data to cache.
|
|
|
35 |
* @return boolean Whether the operation was successful.
|
|
|
36 |
*/
|
|
|
37 |
public function update($data);
|
|
|
38 |
|
|
|
39 |
/**
|
|
|
40 |
* Deletes a cache.
|
|
|
41 |
*
|
|
|
42 |
* @return boolean Whether the operation was successful.
|
|
|
43 |
*/
|
|
|
44 |
public function delete();
|
|
|
45 |
|
|
|
46 |
/**
|
|
|
47 |
* Checks whether the cache object is expired or not.
|
|
|
48 |
*
|
|
|
49 |
* @return boolean Whether the cache is expired or not.
|
|
|
50 |
*/
|
|
|
51 |
public function is_expired();
|
|
|
52 |
|
|
|
53 |
/**
|
|
|
54 |
* Retrieves the timestamp of the cache.
|
|
|
55 |
*
|
|
|
56 |
* @return mixed Either the Unix time stamp of the cache creation, or boolean `false`.
|
|
|
57 |
*/
|
|
|
58 |
public function timestamp();
|
|
|
59 |
|
|
|
60 |
/**
|
|
|
61 |
* Resets the freshness of the cache.
|
|
|
62 |
*
|
|
|
63 |
* @return boolean Whether the operation was successful.
|
|
|
64 |
*/
|
|
|
65 |
public function reset();
|
|
|
66 |
}
|