Andrey Andreev | c5536aa | 2012-11-01 17:33:58 +0200 | [diff] [blame] | 1 | <?php |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
Phil Sturgeon | 07c1ac8 | 2012-03-09 17:03:37 +0000 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.2.4 or newer |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 6 | * |
| 7 | * NOTICE OF LICENSE |
Andrey Andreev | 7d4ea07 | 2011-12-25 19:23:50 +0200 | [diff] [blame] | 8 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 9 | * Licensed under the Open Software License version 3.0 |
Andrey Andreev | 7d4ea07 | 2011-12-25 19:23:50 +0200 | [diff] [blame] | 10 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 11 | * This source file is subject to the Open Software License (OSL 3.0) that is |
| 12 | * bundled with this package in the files license.txt / license.rst. It is |
| 13 | * also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/OSL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 18 | * |
| 19 | * @package CodeIgniter |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 20 | * @author EllisLab Dev Team |
Andrey Andreev | 80500af | 2013-01-01 08:16:53 +0200 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 22 | * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 23 | * @link http://codeigniter.com |
| 24 | * @since Version 2.0 |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 25 | * @filesource |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 26 | */ |
Andrey Andreev | c5536aa | 2012-11-01 17:33:58 +0200 | [diff] [blame] | 27 | defined('BASEPATH') OR exit('No direct script access allowed'); |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 28 | |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 29 | /** |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 30 | * CodeIgniter Dummy Caching Class |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 31 | * |
| 32 | * @package CodeIgniter |
| 33 | * @subpackage Libraries |
| 34 | * @category Core |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 35 | * @author EllisLab Dev Team |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 36 | * @link |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 37 | */ |
Phil Sturgeon | eb2dcda | 2011-04-02 14:44:58 +0100 | [diff] [blame] | 38 | class CI_Cache_dummy extends CI_Driver { |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 39 | |
| 40 | /** |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 41 | * Get |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 42 | * |
| 43 | * Since this is the dummy class, it's always going to return FALSE. |
| 44 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 45 | * @param string |
| 46 | * @return bool FALSE |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 47 | */ |
| 48 | public function get($id) |
| 49 | { |
| 50 | return FALSE; |
| 51 | } |
| 52 | |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 53 | // ------------------------------------------------------------------------ |
| 54 | |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 55 | /** |
| 56 | * Cache Save |
| 57 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 58 | * @param string Unique Key |
| 59 | * @param mixed Data to store |
| 60 | * @param int Length of time (in seconds) to cache the data |
Andrey Andreev | 43d7fa7 | 2014-01-09 17:29:45 +0200 | [diff] [blame^] | 61 | * @param bool Whether to store the raw value |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 62 | * @return bool TRUE, Simulating success |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 63 | */ |
Andrey Andreev | 43d7fa7 | 2014-01-09 17:29:45 +0200 | [diff] [blame^] | 64 | public function save($id, $data, $ttl = 60, $raw = FALSE) |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 65 | { |
| 66 | return TRUE; |
| 67 | } |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 68 | |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 69 | // ------------------------------------------------------------------------ |
| 70 | |
| 71 | /** |
| 72 | * Delete from Cache |
| 73 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 74 | * @param mixed unique identifier of the item in the cache |
Timothy Warren | 0688ac9 | 2012-04-20 10:25:04 -0400 | [diff] [blame] | 75 | * @return bool TRUE, simulating success |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 76 | */ |
| 77 | public function delete($id) |
| 78 | { |
| 79 | return TRUE; |
| 80 | } |
| 81 | |
| 82 | // ------------------------------------------------------------------------ |
| 83 | |
| 84 | /** |
Andrey Andreev | 43d7fa7 | 2014-01-09 17:29:45 +0200 | [diff] [blame^] | 85 | * Increment a raw value |
| 86 | * |
| 87 | * @param string $id Cache ID |
| 88 | * @param int $offset Step/value to add |
| 89 | * @return mixed New value on success or FALSE on failure |
| 90 | */ |
| 91 | public function increment($id, $offset = 1) |
| 92 | { |
| 93 | return TRUE; |
| 94 | } |
| 95 | |
| 96 | // ------------------------------------------------------------------------ |
| 97 | |
| 98 | /** |
| 99 | * Decrement a raw value |
| 100 | * |
| 101 | * @param string $id Cache ID |
| 102 | * @param int $offset Step/value to reduce by |
| 103 | * @return mixed New value on success or FALSE on failure |
| 104 | */ |
| 105 | public function decrement($id, $offset = 1) |
| 106 | { |
| 107 | return TRUE; |
| 108 | } |
| 109 | |
| 110 | // ------------------------------------------------------------------------ |
| 111 | |
| 112 | /** |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 113 | * Clean the cache |
| 114 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 115 | * @return bool TRUE, simulating success |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 116 | */ |
| 117 | public function clean() |
| 118 | { |
| 119 | return TRUE; |
| 120 | } |
| 121 | |
| 122 | // ------------------------------------------------------------------------ |
| 123 | |
| 124 | /** |
| 125 | * Cache Info |
| 126 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 127 | * @param string user/filehits |
| 128 | * @return bool FALSE |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 129 | */ |
| 130 | public function cache_info($type = NULL) |
| 131 | { |
| 132 | return FALSE; |
| 133 | } |
| 134 | |
| 135 | // ------------------------------------------------------------------------ |
| 136 | |
| 137 | /** |
| 138 | * Get Cache Metadata |
| 139 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 140 | * @param mixed key to get cache metadata on |
| 141 | * @return bool FALSE |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 142 | */ |
| 143 | public function get_metadata($id) |
| 144 | { |
| 145 | return FALSE; |
| 146 | } |
| 147 | |
| 148 | // ------------------------------------------------------------------------ |
| 149 | |
| 150 | /** |
| 151 | * Is this caching driver supported on the system? |
| 152 | * Of course this one is. |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 153 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 154 | * @return bool TRUE |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 155 | */ |
| 156 | public function is_supported() |
| 157 | { |
| 158 | return TRUE; |
| 159 | } |
| 160 | |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 161 | } |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 162 | |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 163 | /* End of file Cache_dummy.php */ |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 164 | /* Location: ./system/libraries/Cache/drivers/Cache_dummy.php */ |