| 1 | <?php | = | 1 | <?php |
| 2 | 2 | |||
| 3 | use Illuminate\Support\Str; | 3 | use Illuminate\Support\Str; | |
| 4 | 4 | |||
| 5 | return [ | 5 | return [ | |
| 6 | 6 | |||
| 7 | /* | 7 | /* | |
| 8 | |-------------------------------------------------------------------------- | 8 | |-------------------------------------------------------------------------- | |
| 9 | | Default Cache Store | 9 | | Default Cache Store | |
| 10 | |-------------------------------------------------------------------------- | 10 | |-------------------------------------------------------------------------- | |
| 11 | | | 11 | | | |
| 12 | | This option controls the default cache connection that gets used while | 12 | | This option controls the default cache connection that gets used while | |
| 13 | | using this caching library. This connection is used when another is | 13 | | using this caching library. This connection is used when another is | |
| 14 | | not explicitly specified when executing a given caching function. | 14 | | not explicitly specified when executing a given caching function. | |
| 15 | | | 15 | | | |
| 16 | | Supported: "apc", "array", "database", "file", "memcached", "redis" | <> | 16 | | Supported: "apc", "array", "database", "file", |
| 17 | | "memcached", "redis", "dynamodb" | |||
| 17 | | | = | 18 | | |
| 18 | */ | 19 | */ | |
| 19 | 20 | |||
| 20 | 'default' => env('CACHE_DRIVER', 'file'), | 21 | 'default' => env('CACHE_DRIVER', 'file'), | |
| 21 | 22 | |||
| 22 | /* | 23 | /* | |
| 23 | |-------------------------------------------------------------------------- | 24 | |-------------------------------------------------------------------------- | |
| 24 | | Cache Stores | 25 | | Cache Stores | |
| 25 | |-------------------------------------------------------------------------- | 26 | |-------------------------------------------------------------------------- | |
| 26 | | | 27 | | | |
| 27 | | Here you may define all of the cache "stores" for your application as | 28 | | Here you may define all of the cache "stores" for your application as | |
| 28 | | well as their drivers. You may even define multiple stores for the | 29 | | well as their drivers. You may even define multiple stores for the | |
| 29 | | same cache driver to group types of items stored in your caches. | 30 | | same cache driver to group types of items stored in your caches. | |
| 30 | | | 31 | | | |
| 31 | */ | 32 | */ | |
| 32 | 33 | |||
| 33 | 'stores' => [ | 34 | 'stores' => [ | |
| 34 | 35 | |||
| 35 | 'apc' => [ | 36 | 'apc' => [ | |
| 36 | 'driver' => 'apc', | 37 | 'driver' => 'apc', | |
| 37 | ], | 38 | ], | |
| 38 | 39 | |||
| 39 | 'array' => [ | 40 | 'array' => [ | |
| 40 | 'driver' => 'array', | 41 | 'driver' => 'array', | |
| 41 | ], | 42 | ], | |
| 42 | 43 | |||
| 43 | 'database' => [ | 44 | 'database' => [ | |
| 44 | 'driver' => 'database', | 45 | 'driver' => 'database', | |
| 45 | 'table' => 'cache', | 46 | 'table' => 'cache', | |
| 46 | 'connection' => null, | 47 | 'connection' => null, | |
| 47 | ], | 48 | ], | |
| 48 | 49 | |||
| 49 | 'file' => [ | 50 | 'file' => [ | |
| 50 | 'driver' => 'file', | 51 | 'driver' => 'file', | |
| 51 | 'path' => storage_path('framework/cache/data'), | 52 | 'path' => storage_path('framework/cache/data'), | |
| 52 | ], | 53 | ], | |
| 53 | 54 | |||
| 54 | 'memcached' => [ | 55 | 'memcached' => [ | |
| 55 | 'driver' => 'memcached', | 56 | 'driver' => 'memcached', | |
| 56 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), | 57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), | |
| 57 | 'sasl' => [ | 58 | 'sasl' => [ | |
| 58 | env('MEMCACHED_USERNAME'), | 59 | env('MEMCACHED_USERNAME'), | |
| 59 | env('MEMCACHED_PASSWORD'), | 60 | env('MEMCACHED_PASSWORD'), | |
| 60 | ], | 61 | ], | |
| 61 | 'options' => [ | 62 | 'options' => [ | |
| 62 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, | <> | 63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, |
| 63 | ], | = | 64 | ], |
| 64 | 'servers' => [ | 65 | 'servers' => [ | |
| 65 | [ | 66 | [ | |
| 66 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), | 67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), | |
| 67 | 'port' => env('MEMCACHED_PORT', 11211), | 68 | 'port' => env('MEMCACHED_PORT', 11211), | |
| 68 | 'weight' => 100, | 69 | 'weight' => 100, | |
| 69 | ], | 70 | ], | |
| 70 | ], | 71 | ], | |
| 71 | ], | 72 | ], | |
| 72 | 73 | |||
| 73 | 'redis' => [ | 74 | 'redis' => [ | |
| 74 | 'driver' => 'redis', | 75 | 'driver' => 'redis', | |
| 75 | 'connection' => 'cache', | 76 | 'connection' => 'cache', | |
| 76 | ], | 77 | ], | |
| 77 | 78 | |||
| -+ | 79 | 'dynamodb' => [ | ||
| 80 | 'driver' => 'dynamodb', | |||
| 81 | 'key' => env('AWS_ACCESS_KEY_ID'), | |||
| 82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), | |||
| 83 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), | |||
| 84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), | |||
| 85 | ], | |||
| 86 | ||||
| 78 | ], | = | 87 | ], |
| 79 | 88 | |||
| 80 | /* | 89 | /* | |
| 81 | |-------------------------------------------------------------------------- | 90 | |-------------------------------------------------------------------------- | |
| 82 | | Cache Key Prefix | 91 | | Cache Key Prefix | |
| 83 | |-------------------------------------------------------------------------- | 92 | |-------------------------------------------------------------------------- | |
| 84 | | | 93 | | | |
| 85 | | When utilizing a RAM based store such as APC or Memcached, there might | 94 | | When utilizing a RAM based store such as APC or Memcached, there might | |
| 86 | | be other applications utilizing the same cache. So, we'll specify a | 95 | | be other applications utilizing the same cache. So, we'll specify a | |
| 87 | | value to get prefixed to all our keys so we can avoid collisions. | 96 | | value to get prefixed to all our keys so we can avoid collisions. | |
| 88 | | | 97 | | | |
| 89 | */ | 98 | */ | |
| 90 | 99 | |||
| 91 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), | 100 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), | |
| 92 | 101 | |||
| 93 | ]; | 102 | ]; |