Completed
Push — master ( e02af6...f80686 )
by Nazar
05:32
created

APC   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 6
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 38
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A available_internal() 0 3 1
A get_internal() 0 3 1
A set_internal() 0 3 1
A del_internal() 0 3 1
A increment_internal() 0 3 1
A clean_internal() 0 3 1
1
<?php
2
/**
3
 * @package   CleverStyle CMS
4
 * @author    Nazar Mokrynskyi <[email protected]>
5
 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
 * @license   MIT License, see license.txt
7
 */
8
namespace cs\Cache;
9
/**
10
 * Provides cache functionality based on APCu
11
 */
12
class APC extends _Abstract_with_namespace {
13
	/**
14
	 * @inheritdoc
15
	 */
16
	protected function available_internal () {
17
		return (bool)extension_loaded('apc');
18
	}
19
	/**
20
	 * @inheritdoc
21
	 */
22
	protected function get_internal ($item) {
23
		return apcu_fetch($item);
24
	}
25
	/**
26
	 * @inheritdoc
27
	 */
28
	protected function set_internal ($item, $data) {
29
		return apcu_store($item, $data);
30
	}
31
	/**
32
	 * @inheritdoc
33
	 */
34
	protected function del_internal ($item) {
35
		return apcu_delete($item);
36
	}
37
	/**
38
	 * @inheritdoc
39
	 */
40
	protected function increment_internal ($item) {
41
		return apcu_inc($item);
42
	}
43
	/**
44
	 * @inheritdoc
45
	 */
46
	protected function clean_internal () {
47
		return apcu_clear_cache();
48
	}
49
}
50