]> BookStack Code Mirror - bookstack/blob - config/cache.php
Merge branch 'master' into patch-5
[bookstack] / config / cache.php
1 <?php
2
3 /**
4  * Caching configuration options.
5  *
6  * Changes to these config files are not supported by BookStack and may break upon updates.
7  * Configuration should be altered via the `.env` file or environment variables.
8  * Do not edit this file unless you're happy to maintain any changes yourself.
9  */
10
11 // MEMCACHED - Split out configuration into an array
12 if (env('CACHE_DRIVER') === 'memcached') {
13     $memcachedServerKeys = ['host', 'port', 'weight'];
14     $memcachedServers = explode(',', trim(env('MEMCACHED_SERVERS', '127.0.0.1:11211:100'), ','));
15     foreach ($memcachedServers as $index => $memcachedServer) {
16         $memcachedServerDetails = explode(':', $memcachedServer);
17         if (count($memcachedServerDetails) < 2) $memcachedServerDetails[] = '11211';
18         if (count($memcachedServerDetails) < 3) $memcachedServerDetails[] = '100';
19         $memcachedServers[$index] = array_combine($memcachedServerKeys, $memcachedServerDetails);
20     }
21 }
22
23 return [
24
25     // Default cache store to use
26     // Can be overridden at cache call-time
27     'default' => env('CACHE_DRIVER', 'file'),
28
29     // Available caches stores
30     'stores' => [
31
32         'apc' => [
33             'driver' => 'apc',
34         ],
35
36         'array' => [
37             'driver' => 'array',
38         ],
39
40         'database' => [
41             'driver' => 'database',
42             'table'  => 'cache',
43             'connection' => null,
44         ],
45
46         'file' => [
47             'driver' => 'file',
48             'path'   => storage_path('framework/cache'),
49         ],
50
51         'memcached' => [
52             'driver'  => 'memcached',
53             'servers' => env('CACHE_DRIVER') === 'memcached' ? $memcachedServers : [],
54         ],
55
56         'redis' => [
57             'driver' => 'redis',
58             'connection' => 'default',
59         ],
60
61     ],
62
63     // Cache key prefix
64     // Used to prevent collisions in shared cache systems.
65     'prefix' => env('CACHE_PREFIX', 'bookstack'),
66
67 ];
Morty Proxy This is a proxified and sanitized view of the page, visit original site.