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);
19 |--------------------------------------------------------------------------
21 |--------------------------------------------------------------------------
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.
29 'default' => env('CACHE_DRIVER', 'file'),
32 |--------------------------------------------------------------------------
34 |--------------------------------------------------------------------------
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.
53 'driver' => 'database',
60 'path' => storage_path('framework/cache'),
64 'driver' => 'memcached',
65 'servers' => env('CACHE_DRIVER') === 'memcached' ? $memcachedServers : [],
70 'connection' => 'default',
76 |--------------------------------------------------------------------------
78 |--------------------------------------------------------------------------
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.
86 'prefix' => 'laravel',