Redis

Redis kullanımı veritabanına benzer, örneğin plugin/foo/config/redis.php

return [
    'default' => [
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 0,
    ],
    'cache' => [
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 1,
    ],
];

Kullanımda

use support\Redis;
Redis::connection('plugin.foo.default')->get('key');
Redis::connection('plugin.foo.cache')->get('key');

Aynı şekilde, ana projenin Redis yapılandırmasını tekrar kullanmak isterseniz

use support\Redis;
Redis::get('key');
// Ana projenin ayrıca bir cache bağlantısı yapılandırdığı varsayılsın
Redis::connection('cache')->get('key');