-
-
Notifications
You must be signed in to change notification settings - Fork 339
/
Wincache.php
51 lines (47 loc) · 1.28 KB
/
Wincache.php
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
<?php
/**
* Phalcon Framework
* This source file is subject to the New BSD License that is bundled
* with this package in the file docs/LICENSE.txt.
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @author Nikita Vershinin <[email protected]>
*/
namespace Phalcon\Mvc\Model\MetaData;
use Phalcon\Cache\Backend\Wincache as CacheBackend;
use Phalcon\Cache\Frontend\Data as CacheFrontend;
use Phalcon\Mvc\Model\Exception;
/**
* \Phalcon\Mvc\Model\MetaData\Redis
* Redis adapter for \Phalcon\Mvc\Model\MetaData
*/
class Wincache extends Base
{
/**
* Memcache backend instance.
*
* @var \Phalcon\Cache\Backend\Wincache
*/
protected $wincache = null;
/**
* {@inheritdoc}
*
* @return \Phalcon\Cache\Backend\Wincache
*/
protected function getCacheBackend()
{
if (null === $this->wincache) {
$this->wincache = new CacheBackend(
new CacheFrontend(
[
'lifetime' => $this->options['lifetime'],
]
),
[]
);
}
return $this->wincache;
}
}