]> BookStack Code Mirror - bookstack/blob - app/Config/cache.php
Added 404 response for non-existing setting categories
[bookstack] / app / Config / cache.php
1 <?php
2
3 use Illuminate\Support\Str;
4
5 /**
6  * Caching configuration options.
7  *
8  * Changes to these config files are not supported by BookStack and may break upon updates.
9  * Configuration should be altered via the `.env` file or environment variables.
10  * Do not edit this file unless you're happy to maintain any changes yourself.
11  */
12
13 // MEMCACHED - Split out configuration into an array
14 if (env('CACHE_DRIVER') === 'memcached') {
15     $memcachedServerKeys = ['host', 'port', 'weight'];
16     $memcachedServers = explode(',', trim(env('MEMCACHED_SERVERS', '127.0.0.1:11211:100'), ','));
17     foreach ($memcachedServers as $index => $memcachedServer) {
18         $memcachedServerDetails = explode(':', $memcachedServer);
19         if (count($memcachedServerDetails) < 2) {
20             $memcachedServerDetails[] = '11211';
21         }
22         if (count($memcachedServerDetails) < 3) {
23             $memcachedServerDetails[] = '100';
24         }
25         $memcachedServers[$index] = array_combine($memcachedServerKeys, $memcachedServerDetails);
26     }
27 }
28
29 return [
30
31     // Default cache store to use
32     // Can be overridden at cache call-time
33     'default' => env('CACHE_DRIVER', 'file'),
34
35     // Available caches stores
36     'stores' => [
37
38         'apc' => [
39             'driver' => 'apc',
40         ],
41
42         'array' => [
43             'driver'    => 'array',
44             'serialize' => false,
45         ],
46
47         'database' => [
48             'driver'          => 'database',
49             'table'           => 'cache',
50             'connection'      => null,
51             'lock_connection' => null,
52         ],
53
54         'file' => [
55             'driver' => 'file',
56             'path'   => storage_path('framework/cache'),
57         ],
58
59         'memcached' => [
60             'driver'        => 'memcached',
61             'options'       => [
62                 // Memcached::OPT_CONNECT_TIMEOUT => 2000,
63             ],
64             'servers' => $memcachedServers ?? [],
65         ],
66
67         'redis' => [
68             'driver'          => 'redis',
69             'connection'      => 'default',
70             'lock_connection' => 'default',
71         ],
72
73         'octane' => [
74             'driver' => 'octane',
75         ],
76
77     ],
78
79     /*
80     |--------------------------------------------------------------------------
81     | Cache Key Prefix
82     |--------------------------------------------------------------------------
83     |
84     | When utilizing a RAM based store such as APC or Memcached, there might
85     | be other applications utilizing the same cache. So, we'll specify a
86     | value to get prefixed to all our keys so we can avoid collisions.
87     |
88     */
89
90     'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
91
92 ];
Morty Proxy This is a proxified and sanitized view of the page, visit original site.