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 | * |
Andrey Andreev | fe9309d | 2015-01-09 17:48:58 +0200 | [diff] [blame] | 5 | * An open source application development framework for PHP |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 6 | * |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 7 | * This content is released under the MIT License (MIT) |
Andrey Andreev | 7d4ea07 | 2011-12-25 19:23:50 +0200 | [diff] [blame] | 8 | * |
Andrey Andreev | cce6bd1 | 2018-01-09 11:32:02 +0200 | [diff] [blame^] | 9 | * Copyright (c) 2014 - 2018, British Columbia Institute of Technology |
Andrey Andreev | 7d4ea07 | 2011-12-25 19:23:50 +0200 | [diff] [blame] | 10 | * |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 11 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 12 | * of this software and associated documentation files (the "Software"), to deal |
| 13 | * in the Software without restriction, including without limitation the rights |
| 14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 15 | * copies of the Software, and to permit persons to whom the Software is |
| 16 | * furnished to do so, subject to the following conditions: |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 17 | * |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 18 | * The above copyright notice and this permission notice shall be included in |
| 19 | * all copies or substantial portions of the Software. |
| 20 | * |
| 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 27 | * THE SOFTWARE. |
| 28 | * |
| 29 | * @package CodeIgniter |
| 30 | * @author EllisLab Dev Team |
Andrey Andreev | 1924e87 | 2016-01-11 12:55:34 +0200 | [diff] [blame] | 31 | * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) |
Andrey Andreev | cce6bd1 | 2018-01-09 11:32:02 +0200 | [diff] [blame^] | 32 | * @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/) |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 33 | * @license http://opensource.org/licenses/MIT MIT License |
Andrey Andreev | bd202c9 | 2016-01-11 12:50:18 +0200 | [diff] [blame] | 34 | * @link https://codeigniter.com |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 35 | * @since Version 2.0 |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 36 | * @filesource |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 37 | */ |
Andrey Andreev | c5536aa | 2012-11-01 17:33:58 +0200 | [diff] [blame] | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 39 | |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 40 | /** |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 41 | * CodeIgniter Dummy Caching Class |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 42 | * |
| 43 | * @package CodeIgniter |
| 44 | * @subpackage Libraries |
| 45 | * @category Core |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 46 | * @author EllisLab Dev Team |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 47 | * @link |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 48 | */ |
Phil Sturgeon | eb2dcda | 2011-04-02 14:44:58 +0100 | [diff] [blame] | 49 | class CI_Cache_dummy extends CI_Driver { |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 50 | |
| 51 | /** |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 52 | * Get |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 53 | * |
| 54 | * Since this is the dummy class, it's always going to return FALSE. |
| 55 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 56 | * @param string |
| 57 | * @return bool FALSE |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 58 | */ |
| 59 | public function get($id) |
| 60 | { |
| 61 | return FALSE; |
| 62 | } |
| 63 | |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 64 | // ------------------------------------------------------------------------ |
| 65 | |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 66 | /** |
| 67 | * Cache Save |
| 68 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 69 | * @param string Unique Key |
| 70 | * @param mixed Data to store |
| 71 | * @param int Length of time (in seconds) to cache the data |
Andrey Andreev | 43d7fa7 | 2014-01-09 17:29:45 +0200 | [diff] [blame] | 72 | * @param bool Whether to store the raw value |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 73 | * @return bool TRUE, Simulating success |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 74 | */ |
Andrey Andreev | 43d7fa7 | 2014-01-09 17:29:45 +0200 | [diff] [blame] | 75 | public function save($id, $data, $ttl = 60, $raw = FALSE) |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 76 | { |
| 77 | return TRUE; |
| 78 | } |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 79 | |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 80 | // ------------------------------------------------------------------------ |
| 81 | |
| 82 | /** |
| 83 | * Delete from Cache |
| 84 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 85 | * @param mixed unique identifier of the item in the cache |
Timothy Warren | 0688ac9 | 2012-04-20 10:25:04 -0400 | [diff] [blame] | 86 | * @return bool TRUE, simulating success |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 87 | */ |
| 88 | public function delete($id) |
| 89 | { |
| 90 | return TRUE; |
| 91 | } |
| 92 | |
| 93 | // ------------------------------------------------------------------------ |
| 94 | |
| 95 | /** |
Andrey Andreev | 43d7fa7 | 2014-01-09 17:29:45 +0200 | [diff] [blame] | 96 | * Increment a raw value |
| 97 | * |
| 98 | * @param string $id Cache ID |
| 99 | * @param int $offset Step/value to add |
| 100 | * @return mixed New value on success or FALSE on failure |
| 101 | */ |
| 102 | public function increment($id, $offset = 1) |
| 103 | { |
| 104 | return TRUE; |
| 105 | } |
| 106 | |
| 107 | // ------------------------------------------------------------------------ |
| 108 | |
| 109 | /** |
| 110 | * Decrement a raw value |
| 111 | * |
| 112 | * @param string $id Cache ID |
| 113 | * @param int $offset Step/value to reduce by |
| 114 | * @return mixed New value on success or FALSE on failure |
| 115 | */ |
| 116 | public function decrement($id, $offset = 1) |
| 117 | { |
| 118 | return TRUE; |
| 119 | } |
| 120 | |
| 121 | // ------------------------------------------------------------------------ |
| 122 | |
| 123 | /** |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 124 | * Clean the cache |
| 125 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 126 | * @return bool TRUE, simulating success |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 127 | */ |
| 128 | public function clean() |
| 129 | { |
| 130 | return TRUE; |
| 131 | } |
| 132 | |
| 133 | // ------------------------------------------------------------------------ |
| 134 | |
| 135 | /** |
| 136 | * Cache Info |
| 137 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 138 | * @param string user/filehits |
| 139 | * @return bool FALSE |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 140 | */ |
| 141 | public function cache_info($type = NULL) |
| 142 | { |
| 143 | return FALSE; |
| 144 | } |
| 145 | |
| 146 | // ------------------------------------------------------------------------ |
| 147 | |
| 148 | /** |
| 149 | * Get Cache Metadata |
| 150 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 151 | * @param mixed key to get cache metadata on |
| 152 | * @return bool FALSE |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 153 | */ |
| 154 | public function get_metadata($id) |
| 155 | { |
| 156 | return FALSE; |
| 157 | } |
| 158 | |
| 159 | // ------------------------------------------------------------------------ |
| 160 | |
| 161 | /** |
| 162 | * Is this caching driver supported on the system? |
| 163 | * Of course this one is. |
Eric Barnes | bffb776 | 2011-04-18 00:03:31 -0400 | [diff] [blame] | 164 | * |
Andrey Andreev | b24b033 | 2012-03-26 15:34:39 +0300 | [diff] [blame] | 165 | * @return bool TRUE |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 166 | */ |
| 167 | public function is_supported() |
| 168 | { |
| 169 | return TRUE; |
| 170 | } |
| 171 | |
Greg Aker | bde25d9 | 2010-12-21 09:31:21 -0600 | [diff] [blame] | 172 | } |