blob: 7e2b907a6b6ab37f9339acf2096810427eb89618 [file] [log] [blame]
Andrey Andreevc5536aa2012-11-01 17:33:58 +02001<?php
Greg Akerbde25d92010-12-21 09:31:21 -06002/**
3 * CodeIgniter
4 *
Phil Sturgeon07c1ac82012-03-09 17:03:37 +00005 * An open source application development framework for PHP 5.2.4 or newer
Derek Jonesf4a4bd82011-10-20 12:18:42 -05006 *
7 * NOTICE OF LICENSE
Andrey Andreev7d4ea072011-12-25 19:23:50 +02008 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -05009 * Licensed under the Open Software License version 3.0
Andrey Andreev7d4ea072011-12-25 19:23:50 +020010 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -050011 * 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 Akerbde25d92010-12-21 09:31:21 -060018 *
19 * @package CodeIgniter
Derek Jonesf4a4bd82011-10-20 12:18:42 -050020 * @author EllisLab Dev Team
Andrey Andreev80500af2013-01-01 08:16:53 +020021 * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/)
Derek Jonesf4a4bd82011-10-20 12:18:42 -050022 * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
Greg Akerbde25d92010-12-21 09:31:21 -060023 * @link http://codeigniter.com
24 * @since Version 2.0
Eric Barnesbffb7762011-04-18 00:03:31 -040025 * @filesource
Greg Akerbde25d92010-12-21 09:31:21 -060026 */
Andrey Andreevc5536aa2012-11-01 17:33:58 +020027defined('BASEPATH') OR exit('No direct script access allowed');
Greg Akerbde25d92010-12-21 09:31:21 -060028
Greg Akerbde25d92010-12-21 09:31:21 -060029/**
Eric Barnesbffb7762011-04-18 00:03:31 -040030 * CodeIgniter Dummy Caching Class
Greg Akerbde25d92010-12-21 09:31:21 -060031 *
32 * @package CodeIgniter
33 * @subpackage Libraries
34 * @category Core
Derek Jonesf4a4bd82011-10-20 12:18:42 -050035 * @author EllisLab Dev Team
Eric Barnesbffb7762011-04-18 00:03:31 -040036 * @link
Greg Akerbde25d92010-12-21 09:31:21 -060037 */
Phil Sturgeoneb2dcda2011-04-02 14:44:58 +010038class CI_Cache_dummy extends CI_Driver {
Greg Akerbde25d92010-12-21 09:31:21 -060039
40 /**
Eric Barnesbffb7762011-04-18 00:03:31 -040041 * Get
Greg Akerbde25d92010-12-21 09:31:21 -060042 *
43 * Since this is the dummy class, it's always going to return FALSE.
44 *
Andrey Andreevb24b0332012-03-26 15:34:39 +030045 * @param string
46 * @return bool FALSE
Greg Akerbde25d92010-12-21 09:31:21 -060047 */
48 public function get($id)
49 {
50 return FALSE;
51 }
52
Eric Barnesbffb7762011-04-18 00:03:31 -040053 // ------------------------------------------------------------------------
54
Greg Akerbde25d92010-12-21 09:31:21 -060055 /**
56 * Cache Save
57 *
Andrey Andreevb24b0332012-03-26 15:34:39 +030058 * @param string Unique Key
59 * @param mixed Data to store
60 * @param int Length of time (in seconds) to cache the data
Andrey Andreev43d7fa72014-01-09 17:29:45 +020061 * @param bool Whether to store the raw value
Andrey Andreevb24b0332012-03-26 15:34:39 +030062 * @return bool TRUE, Simulating success
Greg Akerbde25d92010-12-21 09:31:21 -060063 */
Andrey Andreev43d7fa72014-01-09 17:29:45 +020064 public function save($id, $data, $ttl = 60, $raw = FALSE)
Greg Akerbde25d92010-12-21 09:31:21 -060065 {
66 return TRUE;
67 }
Eric Barnesbffb7762011-04-18 00:03:31 -040068
Greg Akerbde25d92010-12-21 09:31:21 -060069 // ------------------------------------------------------------------------
70
71 /**
72 * Delete from Cache
73 *
Andrey Andreevb24b0332012-03-26 15:34:39 +030074 * @param mixed unique identifier of the item in the cache
Timothy Warren0688ac92012-04-20 10:25:04 -040075 * @return bool TRUE, simulating success
Greg Akerbde25d92010-12-21 09:31:21 -060076 */
77 public function delete($id)
78 {
79 return TRUE;
80 }
81
82 // ------------------------------------------------------------------------
83
84 /**
Andrey Andreev43d7fa72014-01-09 17:29:45 +020085 * 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 Akerbde25d92010-12-21 09:31:21 -0600113 * Clean the cache
114 *
Andrey Andreevb24b0332012-03-26 15:34:39 +0300115 * @return bool TRUE, simulating success
Greg Akerbde25d92010-12-21 09:31:21 -0600116 */
117 public function clean()
118 {
119 return TRUE;
120 }
121
122 // ------------------------------------------------------------------------
123
124 /**
125 * Cache Info
126 *
Andrey Andreevb24b0332012-03-26 15:34:39 +0300127 * @param string user/filehits
128 * @return bool FALSE
Greg Akerbde25d92010-12-21 09:31:21 -0600129 */
130 public function cache_info($type = NULL)
131 {
132 return FALSE;
133 }
134
135 // ------------------------------------------------------------------------
136
137 /**
138 * Get Cache Metadata
139 *
Andrey Andreevb24b0332012-03-26 15:34:39 +0300140 * @param mixed key to get cache metadata on
141 * @return bool FALSE
Greg Akerbde25d92010-12-21 09:31:21 -0600142 */
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 Barnesbffb7762011-04-18 00:03:31 -0400153 *
Andrey Andreevb24b0332012-03-26 15:34:39 +0300154 * @return bool TRUE
Greg Akerbde25d92010-12-21 09:31:21 -0600155 */
156 public function is_supported()
157 {
158 return TRUE;
159 }
160
Greg Akerbde25d92010-12-21 09:31:21 -0600161}
Greg Akerbde25d92010-12-21 09:31:21 -0600162
Eric Barnesbffb7762011-04-18 00:03:31 -0400163/* End of file Cache_dummy.php */
Andrey Andreevb24b0332012-03-26 15:34:39 +0300164/* Location: ./system/libraries/Cache/drivers/Cache_dummy.php */