From ce049b9c9602dcc46499228b56ea6ec1c68d76bc Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Tue, 20 Feb 2024 14:15:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8redis=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E7=BC=93=E5=AD=98(=E5=8C=85=E6=8B=ACsession)=20=E8=A7=A3?= =?UTF-8?q?=E5=86=B3session=20lock=E5=A0=B5=E5=A1=9E=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 4 +++- config/web.php | 14 +++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ad99240..c08cdb4 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,9 @@ "gemorroj/archive7z": "^5.7", "npm-asset/viewerjs": "^1.11", "npm-asset/plyr": "^3.7", - "ext-fileinfo": "*" + "ext-fileinfo": "*", + "npm-asset/ace-builds": "^1.32", + "yiisoft/yii2-redis": "^2.0" }, "require-dev": { "yiisoft/yii2-debug": "~2.1.0", diff --git a/config/web.php b/config/web.php index 60f5d88..51cf99e 100644 --- a/config/web.php +++ b/config/web.php @@ -18,8 +18,11 @@ $config = [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => '9vuTNyfQqTOWY8fhAajrAhOfX_uaZqZZ', ], +// 'cache' => [ +// 'class' => 'yii\caching\FileCache', +// ], 'cache' => [ - 'class' => 'yii\caching\FileCache', + 'class' => 'yii\redis\Cache', ], 'user' => [ 'identityClass' => 'app\models\User', @@ -44,6 +47,15 @@ $config = [ ], ], ], + 'session' => [ + 'class' => 'yii\redis\Session', + ], + 'redis' => [ + 'class' => 'yii\redis\Connection', + 'hostname' => 'localhost', + 'port' => 6379, + 'database' => 0, + ], 'db' => $db, /* 'urlManager' => [