Apc::doFlush()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * For the full copyright and license information, please view the LICENSE
4
 * file that was distributed with this source code.
5
 *
6
 * @author Nikita Vershinin <[email protected]>
7
 * @license MIT
8
 */
9
namespace Endeveit\Cache\Drivers;
10
11
use Endeveit\Cache\Abstracts\InMemory;
12
13
/**
14
 * Driver that stores data in APC and uses php5-apc extension.
15
 */
16
class Apc extends InMemory
17
{
18
    /**
19
     * {@inheritdoc}
20
     *
21
     * @codeCoverageIgnore
22
     * @param array $options
23
     */
24
    public function __construct(array $options = array())
25
    {
26
        parent::__construct($options);
27
28
        $this->callbacks = array(
29
            'increment' => 'apc_inc',
30
            'decrement' => 'apc_dec',
31
            'exists'    => 'apc_exists',
32
            'load'      => 'apc_fetch',
33
            'save'      => 'apc_store',
34
        );
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     *
40
     * @return boolean
41
     */
42
    protected function doFlush()
43
    {
44
        return apc_clear_cache('user');
45
    }
46
}
47