3 use Illuminate\Support\Str;
6 * Caching configuration options.
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.
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';
22 if (count($memcachedServerDetails) < 3) {
23 $memcachedServerDetails[] = '100';
25 $memcachedServers[$index] = array_combine($memcachedServerKeys, $memcachedServerDetails);
31 // Default cache store to use
32 // Can be overridden at cache call-time
33 'default' => env('CACHE_DRIVER', 'file'),
35 // Available caches stores
48 'driver' => 'database',
51 'lock_connection' => null,
56 'path' => storage_path('framework/cache'),
60 'driver' => 'memcached',
62 // Memcached::OPT_CONNECT_TIMEOUT => 2000,
64 'servers' => $memcachedServers ?? [],
69 'connection' => 'default',
70 'lock_connection' => 'default',
80 |--------------------------------------------------------------------------
82 |--------------------------------------------------------------------------
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.
90 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),