dirname(dirname(__DIR__)) . '/vendor', 'components' => [ 'request' => [ 'cookieValidationKey' => '3i18DOM7ZDqqQfr2S0hj0c60wFxxTb3J', 'enableCsrfValidation' => false, // 'parsers' => [ // 'application/json' => 'yii\web\JsonParser', // ] // 启用 JSON 输入 // 信息: 上述配置是可选的。若未按上述配置,API 将仅可以分辨 application/x-www-form-urlencoded 和 multipart/form-data 输入格式 ], 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => getenv('DB_DSN'), 'username' => getenv('DB_USERNAME'), 'password' => getenv('DB_PASSWORD'), 'charset' => 'utf8mb4', ], 'db2' => [ 'class' => 'yii\db\Connection', 'dsn' => getenv('DB_DSN_BAK'), 'username' => getenv('DB_USERNAME'), 'password' => getenv('DB_PASSWORD'), 'charset' => 'utf8', ], 'redis' => [ 'class' => 'yii\redis\Connection', 'hostname' => getenv('REDIS_HOST'), 'port' => getenv('REDIS_PORT'), 'database' => 0, 'password' => getenv('REDIS_PASSWORD'), ], //redis发布与订阅 'redisPubSub' => [ 'class' => 'hollisho\redis_pub_sub\RedisPubSub', 'connect' => [ 'class' => 'yii\redis\Connection', 'hostname' => getenv('REDIS_HOST'), 'port' => getenv('REDIS_PORT'), 'database' => getenv('REDIS_DB'), 'password' => getenv('REDIS_PASSWORD'), 'connectionTimeout' => 20, ] ], 'dict' => [ 'class' => 'common\components\configDict', ], 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'useFileTransport' => false, 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.126.com', 'username' => 'zhhinc@126.com', 'password' => '', 'port' => '25', 'encryption' => 'tls', ], 'messageConfig' => [ 'charset' => 'UTF-8', 'from' => ['zhhinc@126.com' => '系统邮件'] ], ], //'rabbitmq' => require(__DIR__ . '/rabbitMQ.php'), // 没在使用 rabbitmq,不配置相关配置 -- 且执行了:composer remove mikemadisonweb/yii2-rabbitmq ], ];