|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | /** |
4 | | - * Broadcasting configuration options. |
| 4 | + * Caching configuration options. |
5 | 5 | * |
6 | 6 | * Changes to these config files are not supported by BookStack and may break upon updates. |
7 | 7 | * Configuration should be altered via the `.env` file or environment variables. |
8 | 8 | * Do not edit this file unless you're happy to maintain any changes yourself. |
9 | 9 | */ |
10 | 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) { |
| 18 | + $memcachedServerDetails[] = '11211'; |
| 19 | + } |
| 20 | + if (count($memcachedServerDetails) < 3) { |
| 21 | + $memcachedServerDetails[] = '100'; |
| 22 | + } |
| 23 | + $memcachedServers[$index] = array_combine($memcachedServerKeys, $memcachedServerDetails); |
| 24 | + } |
| 25 | +} |
| 26 | + |
11 | 27 | return [ |
12 | 28 |
|
13 | | - // Default Broadcaster |
14 | | - // This option controls the default broadcaster that will be used by the |
15 | | - // framework when an event needs to be broadcast. This can be set to |
16 | | - // any of the connections defined in the "connections" array below. |
17 | | - 'default' => env('BROADCAST_DRIVER', 'pusher'), |
18 | | - |
19 | | - // Broadcast Connections |
20 | | - // Here you may define all of the broadcast connections that will be used |
21 | | - // to broadcast events to other systems or over websockets. Samples of |
22 | | - // each available type of connection are provided inside this array. |
23 | | - 'connections' => [ |
24 | | - |
25 | | - 'pusher' => [ |
26 | | - 'driver' => 'pusher', |
27 | | - 'key' => env('PUSHER_APP_KEY'), |
28 | | - 'secret' => env('PUSHER_APP_SECRET'), |
29 | | - 'app_id' => env('PUSHER_APP_ID'), |
30 | | - 'options' => [ |
31 | | - 'cluster' => env('PUSHER_APP_CLUSTER'), |
32 | | - 'useTLS' => true, |
33 | | - ], |
| 29 | + // Default cache store to use |
| 30 | + // Can be overridden at cache call-time |
| 31 | + 'default' => env('CACHE_DRIVER', 'file'), |
| 32 | + |
| 33 | + // Available caches stores |
| 34 | + 'stores' => [ |
| 35 | + |
| 36 | + 'apc' => [ |
| 37 | + 'driver' => 'apc', |
34 | 38 | ], |
35 | 39 |
|
36 | | - 'redis' => [ |
37 | | - 'driver' => 'redis', |
38 | | - 'connection' => 'default', |
| 40 | + 'array' => [ |
| 41 | + 'driver' => 'array', |
| 42 | + 'serialize' => false, |
| 43 | + ], |
| 44 | + |
| 45 | + 'database' => [ |
| 46 | + 'driver' => 'database', |
| 47 | + 'table' => 'cache', |
| 48 | + 'connection' => null, |
| 49 | + 'lock_connection' => null, |
39 | 50 | ], |
40 | 51 |
|
41 | | - 'log' => [ |
42 | | - 'driver' => 'log', |
| 52 | + 'file' => [ |
| 53 | + 'driver' => 'file', |
| 54 | + 'path' => storage_path('framework/cache'), |
43 | 55 | ], |
44 | 56 |
|
45 | | - 'null' => [ |
46 | | - 'driver' => 'null', |
| 57 | + 'memcached' => [ |
| 58 | + 'driver' => 'memcached', |
| 59 | + 'servers' => env('CACHE_DRIVER') === 'memcached' ? $memcachedServers : [], |
| 60 | + 'options' => [], |
| 61 | + ], |
| 62 | + |
| 63 | + 'redis' => [ |
| 64 | + 'driver' => 'redis', |
| 65 | + 'connection' => 'default', |
| 66 | + 'lock_connection' => 'default', |
| 67 | + ], |
| 68 | + |
| 69 | + 'octane' => [ |
| 70 | + 'driver' => 'octane', |
47 | 71 | ], |
48 | 72 |
|
49 | 73 | ], |
50 | 74 |
|
| 75 | + // Cache key prefix |
| 76 | + // Used to prevent collisions in shared cache systems. |
| 77 | + 'prefix' => env('CACHE_PREFIX', 'bookstack_cache'), |
| 78 | + |
51 | 79 | ]; |
0 commit comments