Skip to content
This repository was archived by the owner on Apr 2, 2019. It is now read-only.

Commit 48398bb

Browse files
committed
add null driver
1 parent ec27de8 commit 48398bb

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
namespace Mactronique\PhpCache\Driver;
4+
5+
use Mactronique\PhpCache\Exception\DriverRequirementFailException;
6+
7+
class NullDriver implements Driver
8+
{
9+
const NAME = 'null';
10+
11+
public function checkDriver()
12+
{
13+
}
14+
15+
/**
16+
* @return string Driver name
17+
*/
18+
public function getName()
19+
{
20+
return self::NAME;
21+
}
22+
23+
/**
24+
* @param string $key
25+
* @return mixed
26+
*/
27+
public function get($key)
28+
{
29+
return null;
30+
}
31+
32+
/**
33+
* @param string $key
34+
* @param mixed $value
35+
* @param integer $ttl
36+
* @return mixed
37+
*/
38+
public function set($key, $value, $ttl = null)
39+
{
40+
return true;
41+
}
42+
43+
/**
44+
* @param string $key
45+
* @return boolean
46+
*/
47+
public function exists($key)
48+
{
49+
return false;
50+
}
51+
52+
/**
53+
* @param string $key
54+
*/
55+
public function remove($key)
56+
{
57+
return true;
58+
}
59+
60+
/**
61+
* Remove all keys and value from cache
62+
*/
63+
public function clean()
64+
{
65+
return true;
66+
}
67+
}

0 commit comments

Comments
 (0)