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

APC::available_internal()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
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