root/lang/php/Cache/Resource/Interface.php @ 1523

Revision 1523, 3.6 kB (checked in by takuya, 6 years ago)

ローカルにあるライブラリをUP

Line 
1<?php
2
3/**
4 * Resource Interface definition for Cache_Handler
5 * @package     Cache_Handler
6 * @category    Cache
7 */
8
9interface Cache_Handler_Resource_Interface{
10   
11    /**
12    * Call by hander
13    * definition of save method
14    * @access public
15    * @param $data  object cache data
16    * @param $id    stirng cache id
17    * @param $group array  Array of String. group name of this cache
18    * @return boolean  true (succeeded) / false (faild)
19    */
20    public function save$data, $id, $group = null );
21    /**
22    * Call by hander
23    * definition of remove method
24    * @access public
25    * @param $id    stirng cache id
26    * @return boolean  true (succeeded) / false (faild)
27    */
28    public function remove( $id );
29    /**
30    * Call by hander
31    * definition of clean method
32    * without group name, clean all chache
33    * @access public
34    * @param  String $group    stirng cache group name
35    * @param  Array  $ids array of id removed.
36    * @return boolean  true (succeeded) / false (faild)
37    */
38    public function clean( $group =null, &$ids = null );
39    /**
40    * Call by hander
41    * definition of get method
42    * get Cache data from this resource
43    * @access public
44    * @param $id    stirng cache id
45    * @return string cached data, if cache does not exist, returns null
46    */
47    public function get( $id );
48    /**
49    * Call by hander.
50    * definition of getLastModified method.
51    * get Cache created time from this resource.
52    * @access public
53    * @param $id    stirng cache id
54    * @return string cache created time
55    */
56    public function getLastModified( $id );
57    /**
58    * Call by hander.
59    * Definition of getLastModified method.
60    * Set or update  Cache created(modified) time.
61    * @access public
62    * @param $id    stirng cache id
63    * @param $date  stirng cache created time. default value date("r")
64    * @return String date of cache create or modified time
65    */
66    public function setLastModified( $id, $date );
67//  /**
68//  * Call by hander.
69//  * definition of isExists method.
70//  * check cache exists.
71//  * @access public
72//  * @param $id    stirng cache id
73//  * @return boolean  true (exists) / false (not exists)
74//  */
75//  public function isExists( $id );
76// 
77    /**
78    * Call by hander.
79    * definition of setTimeToLive method.
80    * set or update cache TTL for checking expiration.
81    * @access public
82    * @param $id    stirng cache id
83    * @param $int   int    cache lifetime , default -1
84    * @return boolean  true (succeeded) / false (faild)
85    */
86    public function setTimeToLive( $id, $int = -1 );
87    /**
88    * Call by hander.
89    * definition of getTimeToLive method.
90    * get cache Life time for checking expiration.
91    * @access public
92    * @param $id    stirng cache id
93    * @return int   cache lifetime. if value does not exits , this method return -1.
94    */
95    public function getTimeToLive( $id );
96    /**
97    * Call by hander.
98    * definition of leaveGroup method.
99    * this function make id leave from Cache group.
100    * @access public
101    * @param $id    stirng cache id
102    * @param $group stirng cache group name
103    * @return boolean  true (succeeded) / false (faild)
104    */
105    public function removeFromGroup( $id, $group = null );
106    /**
107    * Call by hander.
108    * definition of joinGroup method.
109    * Add $id to cache group $group
110    * @access public
111    * @param $id    stirng cache id
112    * @param $group stirng cache group name
113    * @return boolean  true (succeeded) / false (faild)
114    */
115    public function addIntoGroup( $id, $group );
116}
Note: See TracBrowser for help on using the browser.