1 | <?php |
||
2 | |||
3 | if (!function_exists('cache_path')) { |
||
4 | /** |
||
5 | * @param null $path |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
6 | * @return string |
||
7 | */ |
||
8 | function cache_path($path = null) |
||
9 | { |
||
10 | 7 | $base = '/tmp'; |
|
11 | |||
12 | 7 | if (defined('CACHE_PATH')) { |
|
13 | 7 | $base = CACHE_PATH; |
|
14 | } |
||
15 | |||
16 | 7 | if (function_exists('app') && app()->has('path.storage')) { |
|
17 | $base = app('path.storage') . DIRECTORY_SEPARATOR . 'cache'; |
||
18 | } |
||
19 | |||
20 | 7 | return $base . ($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
0 ignored issues
–
show
|
|||
21 | } |
||
22 | } |
||
23 | |||
24 | |||
25 | if (!function_exists('cache')) { |
||
26 | /** |
||
27 | * @return \Nip\Cache\Manager |
||
28 | */ |
||
29 | function cache() |
||
30 | { |
||
31 | if (function_exists('app')) { |
||
32 | // $base = app('cache') . DIRECTORY_SEPARATOR . 'cache'; |
||
33 | } |
||
34 | |||
35 | return \Nip\Cache\Manager::instance(); |
||
36 | } |
||
37 | } |
||
38 |