]> BookStack Code Mirror - bookstack/blob - config/cache.php
Added basic system tests for markdown editor, Added extra test helpers
[bookstack] / config / cache.php
1 <?php
2
3 // MEMCACHED - Split out configuration into an array
4 if (env('CACHE_DRIVER') === 'memcached') {
5     $memcachedServerKeys = ['host', 'port', 'weight'];
6     $memcachedServers = explode(',', trim(env('MEMCACHED_SERVERS', '127.0.0.1:11211:100'), ','));
7     foreach ($memcachedServers as $index => $memcachedServer) {
8         $memcachedServerDetails = explode(':', $memcachedServer);
9         $components = count($memcachedServerDetails);
10         if ($components < 2) $memcachedServerDetails[] = '11211';
11         if ($components < 3) $memcachedServerDetails[] = '100';
12         $memcachedServers[$index] = array_combine($memcachedServerKeys, $memcachedServerDetails);
13     }
14 }
15
16 return [
17
18     /*
19     |--------------------------------------------------------------------------
20     | Default Cache Store
21     |--------------------------------------------------------------------------
22     |
23     | This option controls the default cache connection that gets used while
24     | using this caching library. This connection is used when another is
25     | not explicitly specified when executing a given caching function.
26     |
27     */
28
29     'default' => env('CACHE_DRIVER', 'file'),
30
31     /*
32     |--------------------------------------------------------------------------
33     | Cache Stores
34     |--------------------------------------------------------------------------
35     |
36     | Here you may define all of the cache "stores" for your application as
37     | well as their drivers. You may even define multiple stores for the
38     | same cache driver to group types of items stored in your caches.
39     |
40     */
41
42     'stores' => [
43
44         'apc' => [
45             'driver' => 'apc',
46         ],
47
48         'array' => [
49             'driver' => 'array',
50         ],
51
52         'database' => [
53             'driver' => 'database',
54             'table'  => 'cache',
55             'connection' => null,
56         ],
57
58         'file' => [
59             'driver' => 'file',
60             'path'   => storage_path('framework/cache'),
61         ],
62
63         'memcached' => [
64             'driver'  => 'memcached',
65             'servers' => env('CACHE_DRIVER') === 'memcached' ? $memcachedServers : [],
66         ],
67
68         'redis' => [
69             'driver' => 'redis',
70             'connection' => 'default',
71         ],
72
73     ],
74
75     /*
76     |--------------------------------------------------------------------------
77     | Cache Key Prefix
78     |--------------------------------------------------------------------------
79     |
80     | When utilizing a RAM based store such as APC or Memcached, there might
81     | be other applications utilizing the same cache. So, we'll specify a
82     | value to get prefixed to all our keys so we can avoid collisions.
83     |
84     */
85
86     'prefix' => 'laravel',
87
88 ];