|
14 | 14 | 'components' => [ |
15 | 15 | 'request' => [ |
16 | 16 | 'cookieValidationKey' => 'test-secret-key', |
17 | | - 'enableCsrfValidation' => false, // Disable CSRF for API testing |
| 17 | + 'enableCsrfValidation' => false, |
18 | 18 | 'baseUrl' => '', |
19 | 19 | 'scriptUrl' => '/index.php', |
| 20 | + 'parsers' => [ |
| 21 | + 'application/json' => 'yii\web\JsonParser', |
| 22 | + ], |
20 | 23 | ], |
21 | 24 | 'assetManager' => [ |
22 | 25 | 'basePath' => dirname(__DIR__) . '/web/assets', |
|
27 | 30 | 'redis' => 'redis', |
28 | 31 | 'keyPrefix' => 'phpsession:', |
29 | 32 | 'timeout' => (int)(getenv('YII_SESSION_TIMEOUT') ?: 1440), |
30 | | - 'autoCloseOnCoroutineEnd' => false, // Disable auto-close to prevent conflicts |
31 | 33 | ], |
32 | 34 | 'user' => [ |
33 | 35 | 'class' => \Dacheng\Yii2\Swoole\User\CoroutineUser::class, |
|
48 | 50 | 'targets' => [ |
49 | 51 | [ |
50 | 52 | 'class' => \Dacheng\Yii2\Swoole\Log\CoroutineFileTarget::class, |
51 | | - 'levels' => ['error', 'warning', 'info'], |
| 53 | + 'levels' => ['error', 'warning'], |
52 | 54 | 'exportInterval' => 1, |
53 | 55 | 'logFile' => '@runtime/logs/app.log', |
54 | 56 | 'channelSize' => (int)(getenv('YII_LOG_CHANNEL_SIZE') ?: 10000), |
55 | 57 | 'pushTimeout' => 0.5, |
56 | | - 'batchSize' => 1000, // Packets per batch write |
57 | | - 'maxFileSize' => 10240, // 10MB |
| 58 | + 'batchSize' => 1000, |
| 59 | + 'maxFileSize' => 10240, |
58 | 60 | 'maxLogFiles' => 5, |
59 | 61 | 'enableRotation' => true, |
60 | 62 | 'categories' => [], |
61 | 63 | 'except' => [], |
62 | | - 'logVars' => [], |
| 64 | + 'logVars' => false, |
63 | 65 | 'microtime' => true, |
64 | 66 | ], |
65 | 67 | ], |
|
79 | 81 | $config = \yii\helpers\ArrayHelper::merge($commonConfig, $config); |
80 | 82 |
|
81 | 83 | if (YII_ENV_DEV) { |
82 | | - // configuration adjustments for 'dev' environment when optional packages are present |
83 | | - |
84 | | - // Debug module is disabled for Swoole compatibility |
85 | | - // TODO: Fix debug module to work properly with Swoole coroutines |
86 | | - /* |
87 | 84 | if (class_exists('yii\\debug\\Module')) { |
88 | 85 | $config['bootstrap'][] = 'debug'; |
89 | 86 | $config['modules']['debug'] = [ |
90 | | - 'class' => \Dacheng\Yii2\Swoole\Debug\CoroutineDebugModule::class, |
91 | | - 'allowedIPs' => ['127.0.0.1', '::1'], |
92 | | - 'historySize' => 50, |
93 | | - 'traceLine' => '<a href="file://{file}" title="{file}">{file}:{line}</a>', |
| 87 | + 'class' => 'yii\\debug\\Module', |
94 | 88 | ]; |
95 | 89 | } |
96 | | - */ |
97 | 90 |
|
98 | 91 | if (class_exists('yii\\gii\\Module')) { |
99 | 92 | $config['bootstrap'][] = 'gii'; |
100 | 93 | $config['modules']['gii'] = [ |
101 | 94 | 'class' => 'yii\\gii\\Module', |
102 | | - // uncomment the following to add your IP if you are not connecting from localhost. |
103 | | - //'allowedIPs' => ['127.0.0.1', '::1'], |
104 | 95 | ]; |
105 | 96 | } |
106 | 97 | } |
|
0 commit comments