This repository has been archived by the owner on Jan 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
/
Cache.php
executable file
·71 lines (64 loc) · 1.72 KB
/
Cache.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* This file is part of Handlebars-php
* Base on mustache-php https://github.com/bobthecow/mustache.php
*
* PHP version 5.3
*
* @category Xamin
* @package Handlebars
* @author fzerorubigd <fzerorubigd@gmail.com>
* @author Behrooz Shabani <everplays@gmail.com>
* @author Mária Šormanová <maria.sormanova@gmail.com>
* @copyright 2012 (c) ParsPooyesh Co
* @copyright 2013 (c) Behrooz Shabani
* @license MIT <http://opensource.org/licenses/MIT>
* @version GIT: $Id$
* @link http://xamin.ir
*/
namespace Handlebars;
/**
* Cache interface
* Base cache interface, Note that Handlebars.php never call for remove.
* Driver should take care of expiered cache.
*
* @category Xamin
* @package Handlebars
* @author fzerorubigd <fzerorubigd@gmail.com>
* @copyright 2010-2012 (c) Justin Hileman
* @copyright 2012 (c) ParsPooyesh Co
* @license MIT <http://opensource.org/licenses/MIT>
* @version Release: @package_version@
* @link http://xamin.ir
*/
interface Cache
{
/**
* Get cache for $name if exist.
*
* @param string $name Cache id
*
* @return mixed data on hit, boolean false on cache not found
*/
public function get($name);
/**
* Set a cache with $ttl, if present
* If $ttl set to -1, the cache expires immediately
* If $ttl set to 0 (default), cache is never purged
*
* @param string $name cache id
* @param mixed $value data to store
* @param int $ttl time to live in seconds
*
* @return void
*/
public function set($name, $value, $ttl = 0);
/**
* Remove cache
*
* @param string $name Cache id
*
* @return void
*/
public function remove($name);
}