aboutsummaryrefslogtreecommitdiffstats
path: root/tests/class_loader/cache_mock.php
blob: 73d1e64cf59c883c5836ed62baff18f2459e9592 (plain)
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
72
73
74
<?php
/**
*
* @package testing
* @version $Id$
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

require '../phpBB/includes/cache/driver/interface.php';

class phpbb_cache_mock implements phpbb_cache_driver_interface
{
	private $variables = array();

	function get($var_name)
	{
		if (isset($this->variables[$var_name]))
		{
			return $this->variables[$var_name];
		}

		return false;
	}

	function put($var_name, $value, $ttl = 0)
	{
		$this->variables[$var_name] = $value;
	}

	function load()
	{
	}
	function unload()
	{
	}
	function save()
	{
	}
	function tidy()
	{
	}
	function purge()
	{
	}
	function destroy($var_name, $table = '')
	{
	}
	public function _exists($var_name)
	{
	}
	public function sql_load($query)
	{
	}
	public function sql_save($query, &$query_result, $ttl)
	{
	}
	public function sql_exists($query_id)
	{
	}
	public function sql_fetchrow($query_id)
	{
	}
	public function sql_fetchfield($query_id, $field)
	{
	}
	public function sql_rowseek($rownum, $query_id)
	{
	}
	public function sql_freeresult($query_id)
	{
	}
}