Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
wincache
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 4
30
0.00% covered (danger)
0.00%
0 / 1
 purge
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 _read
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
 _write
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 _delete
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14namespace phpbb\cache\driver;
15
16/**
17* ACM for WinCache
18*/
19class wincache extends \phpbb\cache\driver\memory
20{
21    var $extension = 'wincache';
22
23    /**
24    * {@inheritDoc}
25    */
26    function purge()
27    {
28        wincache_ucache_clear();
29
30        parent::purge();
31    }
32
33    /**
34     * {@inheritDoc}
35     */
36    protected function _read(string $var)
37    {
38        $success = false;
39        $result = wincache_ucache_get($this->key_prefix . $var, $success);
40
41        return ($success) ? $result : false;
42    }
43
44    /**
45    * {@inheritDoc}
46    */
47    protected function _write(string $var, $data, int $ttl = 2592000): bool
48    {
49        return wincache_ucache_set($this->key_prefix . $var, $data, $ttl);
50    }
51
52    /**
53     * {@inheritDoc}
54     */
55    protected function _delete(string $var): bool
56    {
57        return wincache_ucache_delete($this->key_prefix . $var);
58    }
59}