Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/*
3
 *  $Id: Interface.php 7490 2010-03-29 19:53:27Z jwage $
4
 *
5
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
 *
17
 * This software consists of voluntary contributions made by many individuals
18
 * and is licensed under the LGPL. For more information, see
19
 * <http://www.doctrine-project.org>.
20
 */
21
 
22
/**
23
 * Doctrine cache driver interface
24
 *
25
 * @package     Doctrine
26
 * @subpackage  Cache
27
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28
 * @link        www.doctrine-project.org
29
 * @since       1.0
30
 * @version     $Revision: 7490 $
31
 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
32
 * @author      Jonathan H. Wage <jonwage@gmail.com>
33
 */
34
interface Doctrine_Cache_Interface
35
{
36
    /**
37
     * Fetch a cache record from this cache driver instance
38
     *
39
     * @param string $id cache id
40
     * @param boolean $testCacheValidity        if set to false, the cache validity won't be tested
41
     * @return mixed  Returns either the cached data or false
42
     */
43
    public function fetch($id, $testCacheValidity = true);
44
 
45
    /**
46
     * Test if a cache record exists for the passed id
47
     *
48
     * @param string $id cache id
49
     * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
50
     */
51
    public function contains($id);
52
 
53
    /**
54
     * Save a cache record and add the key to the index of cached keys
55
     *
56
     * @param string $id        cache id
57
     * @param string $data      data to cache
58
     * @param int $lifeTime     if != false, set a specific lifetime for this cache record (null => infinite lifeTime)
59
     * @return boolean true if no problem
60
     */
61
    public function save($id, $data, $lifeTime = false);
62
 
63
    /**
64
     * Remove a cache record
65
     *
66
     * @param string $id cache id
67
     * @return boolean true if no problem
68
     */
69
    public function delete($id);
70
}