Completed
Push — master ( 0f9479...65c76e )
by Angus
02:49
created

Cacher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A initiate_cache() 0 4 1
1
<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
2
3
//Because we can't autoload the cache driver with params - https://forum.codeigniter.com/thread-62217-post-319687.html#pid319687
4
class Cacher {
5
	protected $CI;
6
7 119
	public function __construct() {
8 119
		$this->CI =& get_instance(); //grab an instance of CI
9 119
		$this->initiate_cache();
10 119
	}
11
12 119
	public function initiate_cache() {
13 119
		$this->CI->load->driver('cache', array('adapter' => 'file', 'backup' => 'apc')); //Sadly we can't autoload this with params
14
		//FIXME: We would just use APC caching, but it's a bit more tricky to manage with multiple site setups..
15 119
	}
16
}
17