Skip to content

Commit 301ddcc

Browse files
committed
Readded CachePool
1 parent 870b38d commit 301ddcc

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

src/MongoDBCachePool.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
/*
4+
* This file is part of php-cache\mongodb-adapter package.
5+
*
6+
* (c) 2015-2015 Aaron Scherer <[email protected]>, Tobias Nyholm <[email protected]>
7+
*
8+
* This source file is subject to the MIT license that is bundled
9+
* with this source code in the file LICENSE.
10+
*/
11+
12+
namespace Cache\Adapter\MongoDB;
13+
14+
use Cache\Adapter\Common\AbstractCachePool;
15+
use Psr\Cache\CacheItemInterface;
16+
use MongoDB\Client;
17+
18+
/**
19+
* @author Tobias Nyholm <[email protected]>
20+
*/
21+
class MongoDBCachePool extends AbstractCachePool
22+
{
23+
/**
24+
* @var Client
25+
*/
26+
private $client;
27+
28+
/**
29+
*
30+
* @param Client $client
31+
*/
32+
public function __construct(Client $client)
33+
{
34+
$this->client = $client;
35+
}
36+
37+
protected function fetchObjectFromCache($key)
38+
{
39+
return false;
40+
}
41+
42+
protected function clearAllObjectsFromCache()
43+
{
44+
return true;
45+
}
46+
47+
protected function clearOneObjectFromCache($key)
48+
{
49+
return true;
50+
}
51+
52+
protected function storeItemInCache($key, CacheItemInterface $item, $ttl)
53+
{
54+
return true;
55+
}
56+
}

0 commit comments

Comments
 (0)