Cache.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php namespace Config;
  2. use CodeIgniter\Config\BaseConfig;
  3. class Cache extends BaseConfig
  4. {
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Primary Handler
  8. |--------------------------------------------------------------------------
  9. |
  10. | The name of the preferred handler that should be used. If for some reason
  11. | it is not available, the $backupHandler will be used in its place.
  12. |
  13. */
  14. public $handler = 'file';
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Backup Handler
  18. |--------------------------------------------------------------------------
  19. |
  20. | The name of the handler that will be used in case the first one is
  21. | unreachable. Often, 'file' is used here since the filesystem is
  22. | always available, though that's not always practical for the app.
  23. |
  24. */
  25. public $backupHandler = 'dummy';
  26. /*
  27. |--------------------------------------------------------------------------
  28. | Cache Directory Path
  29. |--------------------------------------------------------------------------
  30. |
  31. | The path to where cache files should be stored, if using a file-based
  32. | system.
  33. |
  34. */
  35. public $storePath = WRITEPATH . 'cache/';
  36. /*
  37. |--------------------------------------------------------------------------
  38. | Cache Include Query String
  39. |--------------------------------------------------------------------------
  40. |
  41. | Whether to take the URL query string into consideration when generating
  42. | output cache files. Valid options are:
  43. |
  44. | false = Disabled
  45. | true = Enabled, take all query parameters into account.
  46. | Please be aware that this may result in numerous cache
  47. | files generated for the same page over and over again.
  48. | array('q') = Enabled, but only take into account the specified list
  49. | of query parameters.
  50. |
  51. */
  52. public $cacheQueryString = false;
  53. /*
  54. |--------------------------------------------------------------------------
  55. | Key Prefix
  56. |--------------------------------------------------------------------------
  57. |
  58. | This string is added to all cache item names to help avoid collisions
  59. | if you run multiple applications with the same cache engine.
  60. |
  61. */
  62. public $prefix = '';
  63. /*
  64. | -------------------------------------------------------------------------
  65. | Memcached settings
  66. | -------------------------------------------------------------------------
  67. | Your Memcached servers can be specified below, if you are using
  68. | the Memcached drivers.
  69. |
  70. | See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
  71. |
  72. */
  73. public $memcached = [
  74. 'host' => '127.0.0.1',
  75. 'port' => 11211,
  76. 'weight' => 1,
  77. 'raw' => false,
  78. ];
  79. /*
  80. | -------------------------------------------------------------------------
  81. | Redis settings
  82. | -------------------------------------------------------------------------
  83. | Your Redis server can be specified below, if you are using
  84. | the Redis or Predis drivers.
  85. |
  86. */
  87. public $redis = [
  88. 'host' => '127.0.0.1',
  89. 'password' => null,
  90. 'port' => 6379,
  91. 'timeout' => 0,
  92. 'database' => 0,
  93. ];
  94. /*
  95. |--------------------------------------------------------------------------
  96. | Available Cache Handlers
  97. |--------------------------------------------------------------------------
  98. |
  99. | This is an array of cache engine alias' and class names. Only engines
  100. | that are listed here are allowed to be used.
  101. |
  102. */
  103. public $validHandlers = [
  104. 'dummy' => \CodeIgniter\Cache\Handlers\DummyHandler::class,
  105. 'file' => \CodeIgniter\Cache\Handlers\FileHandler::class,
  106. 'memcached' => \CodeIgniter\Cache\Handlers\MemcachedHandler::class,
  107. 'predis' => \CodeIgniter\Cache\Handlers\PredisHandler::class,
  108. 'redis' => \CodeIgniter\Cache\Handlers\RedisHandler::class,
  109. 'wincache' => \CodeIgniter\Cache\Handlers\WincacheHandler::class,
  110. ];
  111. }