kba-team / cakephp-predis
Predis cache engine for CakePHP
Installs: 14 092
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:cakephp-plugin
pkg:composer/kba-team/cakephp-predis
Requires
- php: >=8.1 <8.4
- ext-redis: *
- cakephp/cakephp: ^5.0
- predis/predis: ^1.1
README
Predis plugin for CakePHP 2.x
Usage
composer require kba-team/cakephp-predis
In bootstrap.php load the Plugin ...
CakePlugin::load("PredisCache");
In your config file ...
Cache::config('_session_', [ 'engine' => 'PredisCache.Predis', 'sentinel' => ['<sentinel host 1>', ...., '<sentinel host n>'], 'password' => "<password>", 'port' => 26379, 'exceptions' => true, 'database' => 1, 'prefix' => "", 'duration' => '+2 days', ]);
Possible configuration parameters are:
enginePredisschemeCurrently, TCP onlyprefixSee CakePhp 2.x CachingserverRedis server (must be master),sentinelList of sentinel nodes (hostnames or IP addresses)portEither redis Port (6379) isserveris used otherwise the sentinel port (26379)exceptionsShould exceptions be thrown or not (true)databaseSee CakePhp 2.x Caching => 0,passwordRedis passwordserviceSentinel only: Sentinel service name (mymaster)
Further reading
- About CakePHP 2.x Caching