| @@ 51-68 (lines=18) @@ | ||
| 48 | ||
| 49 | break; |
|
| 50 | ||
| 51 | case 'filesystem': |
|
| 52 | $path = $config->get('cache.filesystem.path', 'cache'); |
|
| 53 | ||
| 54 | // If no path is given, fall back to the system's temporary directory |
|
| 55 | if (empty($path)) |
|
| 56 | { |
|
| 57 | $path = sys_get_temp_dir(); |
|
| 58 | } |
|
| 59 | ||
| 60 | // If the path is relative, make it absolute |
|
| 61 | if (substr($path, 0, 1) !== '/') |
|
| 62 | { |
|
| 63 | $path = APPROOT . '/' . $path; |
|
| 64 | } |
|
| 65 | ||
| 66 | $handler = new Cache\FilesystemCache($path); |
|
| 67 | ||
| 68 | break; |
|
| 69 | ||
| 70 | case 'phpfile': |
|
| 71 | $path = $config->get('cache.phpfile.path', 'cache'); |
|
| @@ 70-87 (lines=18) @@ | ||
| 67 | ||
| 68 | break; |
|
| 69 | ||
| 70 | case 'phpfile': |
|
| 71 | $path = $config->get('cache.phpfile.path', 'cache'); |
|
| 72 | ||
| 73 | // If no path is given, fall back to the system's temporary directory |
|
| 74 | if (empty($path)) |
|
| 75 | { |
|
| 76 | $path = sys_get_temp_dir(); |
|
| 77 | } |
|
| 78 | ||
| 79 | // If the path is relative, make it absolute |
|
| 80 | if (substr($path, 0, 1) !== '/') |
|
| 81 | { |
|
| 82 | $path = APPROOT . '/' . $path; |
|
| 83 | } |
|
| 84 | ||
| 85 | $handler = new Cache\PhpFileCache($path); |
|
| 86 | ||
| 87 | break; |
|
| 88 | ||
| 89 | default: |
|
| 90 | throw new \InvalidArgumentException(sprintf('The "%s" cache adapter is not supported.', $adapter)); |
|