Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Yii2 Redis Laravel Package

yiisoft/yii2-redis

Yii2 Redis extension providing Redis connection plus Cache, Session, and Mutex handlers, and an ActiveRecord layer to store and query structured data in Redis using familiar Yii2 patterns. Requires Redis 2.6.12+ and PHP 7.4+ (best on PHP 8).

View on GitHub
Deep Wiki
Context7

インストール

必要条件

全てのコンポーネントが正しく動作するためには、最低限、redis バージョン 2.6.12 が必要です。

Composer パッケージを取得する

このエクステンションをインストールするのに推奨される方法は composer によるものです。

下記のコマンドを実行してください。

php composer.phar require --prefer-dist yiisoft/yii2-redis

または、あなたの composer.json ファイルの require セクションに、

"yiisoft/yii2-redis": "~2.0.0"

を追加してください。

アプリケーションを構成する

このエクステンションを使用するためには、アプリケーション構成情報で [[yii\redis\Connection|Connection]] クラスを構成する必要があります。

return [
    //....
    'components' => [
        'redis' => [
            'class' => 'yii\redis\Connection',
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 0,
        ],
    ]
];

これで、redis アプリケーション・コンポーネントによって、redis ストレージに対する基本的なアクセスが提供されるようになります。

Yii::$app->redis->set('mykey', 'some value');
echo Yii::$app->redis->get('mykey');

利用可能なメソッドの一覧は [[yii\redis\Connection]] を参照して下さい。

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver