You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.9 KiB

  1. <?php
  2. /*
  3. * cache.php
  4. * Copyright (c) 2021 james@firefly-iii.org
  5. *
  6. * This file is part of the Firefly III Data Importer
  7. * (https://github.com/firefly-iii/data-importer).
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  21. */
  22. declare(strict_types=1);
  23. use Illuminate\Support\Str;
  24. return [
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Default Cache Store
  28. |--------------------------------------------------------------------------
  29. |
  30. | This option controls the default cache connection that gets used while
  31. | using this caching library. This connection is used when another is
  32. | not explicitly specified when executing a given caching function.
  33. |
  34. | Supported: "apc", "array", "database", "file",
  35. | "memcached", "redis", "dynamodb"
  36. |
  37. */
  38. 'default' => env('CACHE_DRIVER', 'file'),
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Cache Stores
  42. |--------------------------------------------------------------------------
  43. |
  44. | Here you may define all of the cache "stores" for your application as
  45. | well as their drivers. You may even define multiple stores for the
  46. | same cache driver to group types of items stored in your caches.
  47. |
  48. */
  49. 'stores' => [
  50. 'apc' => [
  51. 'driver' => 'apc',
  52. ],
  53. 'array' => [
  54. 'driver' => 'array',
  55. 'serialize' => false,
  56. ],
  57. 'database' => [
  58. 'driver' => 'database',
  59. 'table' => 'cache',
  60. 'connection' => null,
  61. ],
  62. 'file' => [
  63. 'driver' => 'file',
  64. 'path' => storage_path('framework/cache/data'),
  65. ],
  66. 'memcached' => [
  67. 'driver' => 'memcached',
  68. 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
  69. 'sasl' => [
  70. env('MEMCACHED_USERNAME'),
  71. env('MEMCACHED_PASSWORD'),
  72. ],
  73. 'options' => [
  74. // Memcached::OPT_CONNECT_TIMEOUT => 2000,
  75. ],
  76. 'servers' => [
  77. [
  78. 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
  79. 'port' => env('MEMCACHED_PORT', 11211),
  80. 'weight' => 100,
  81. ],
  82. ],
  83. ],
  84. 'redis' => [
  85. 'driver' => 'redis',
  86. 'connection' => 'cache',
  87. ],
  88. 'dynamodb' => [
  89. 'driver' => 'dynamodb',
  90. 'key' => env('AWS_ACCESS_KEY_ID'),
  91. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  92. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  93. 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
  94. 'endpoint' => env('DYNAMODB_ENDPOINT'),
  95. ],
  96. ],
  97. /*
  98. |--------------------------------------------------------------------------
  99. | Cache Key Prefix
  100. |--------------------------------------------------------------------------
  101. |
  102. | When utilizing a RAM based store such as APC or Memcached, there might
  103. | be other applications utilizing the same cache. So, we'll specify a
  104. | value to get prefixed to all our keys so we can avoid collisions.
  105. |
  106. */
  107. 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
  108. ];