forked from PHPSocialNetwork/phpfastcache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extendedPhpFastCache.php
54 lines (49 loc) · 1.3 KB
/
extendedPhpFastCache.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
*
* This file is part of phpFastCache.
*
* @license MIT License (MIT)
*
* For full copyright and license information, please see the docs/CREDITS.txt file.
*
* @author Khoa Bui (khoaofgod) <khoaofgod@gmail.com> https://www.phpfastcache.com
* @author Georges.L (Geolim4) <contact@geolim4.com>
*
*/
namespace MyCustom\Project;
use Phpfastcache\Drivers\Files\Driver as FilesDriver;
use Phpfastcache\Proxy\PhpfastcacheAbstractProxy;
/**
* Specific driver-based example
* Class extendsPhpFastCache
* @package MyCustom\Project
*/
class extendedPhpFastCache extends FilesDriver
{
public function __construct(array $config = [])
{
$config[ 'path' ] = 'your/custom/path/where/files/will/be/written';
parent::__construct($config);
/**
* That's all !! Your cache class is ready to use
*/
}
}
/**
* Dynamic driver-based example
* Class myCustomCacheClass
* @package MyCustom\Project
*/
class myCustomCacheClass extends PhpfastcacheAbstractProxy
{
public function __construct($driver = '', array $config = [])
{
$config[ 'path' ] = 'your/custom/path/where/files/will/be/written';
$driver = 'files';
parent::__construct($driver, $config);
/**
* That's all !! Your cache class is ready to use
*/
}
}