Redis

Redis-এর ব্যবহার ডেটাবেজের সঙ্গে সাদৃশ্যপূর্ণ, যেমন 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,
    ],
];

ব্যবহারের সময়

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

একইভাবে, যদি প্রধান প্রকল্পের Redis কনফিগারেশন পুনরায় ব্যবহার করতে চান

use support\Redis;
Redis::get('key');
// অনুমান করুন প্রধান প্রকল্পে একটি cache সংযোগও কনফিগার করা আছে
Redis::connection('cache')->get('key');