main-local.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. return [
  3. 'components' => [
  4. 'db' => [
  5. 'class' => 'yii\db\Connection',
  6. 'dsn' => 'mysql:host=127.0.0.1;dbname=rageframe',
  7. 'username' => 'root',
  8. 'password' => '',
  9. 'charset' => 'utf8mb4',
  10. 'tablePrefix' => 'rf_',
  11. 'attributes' => [
  12. // PDO::ATTR_STRINGIFY_FETCHES => false, // 提取的时候将数值转换为字符串
  13. // PDO::ATTR_EMULATE_PREPARES => false, // 启用或禁用预处理语句的模拟
  14. ],
  15. // 'enableSchemaCache' => true, // 是否开启缓存, 请了解其中机制在开启,不了解谨慎
  16. // 'schemaCacheDuration' => 3600, // 缓存时间
  17. // 'schemaCache' => 'cache', // 缓存名称
  18. ],
  19. /**
  20. // redis缓存
  21. // 注意:系统默认开启了file缓存的保存路径,如果开启redis或者其他缓存请去main里面删除
  22. * 'cache' => [
  23. 'class' => 'yii\redis\Cache',
  24. ],
  25. // session写入缓存配置
  26. 'session' => [
  27. 'class' => 'yii\redis\Session',
  28. 'redis' => [
  29. 'class' => 'yii\redis\Connection',
  30. 'hostname' => 'localhost',
  31. 'port' => 6379,
  32. 'database' => 0,
  33. ],
  34. ],
  35. */
  36. 'mailer' => [
  37. 'class' => 'yii\swiftmailer\Mailer',
  38. 'viewPath' => '@common/mail',
  39. // send all mails to a file by default. You have to set
  40. // 'useFileTransport' to false and configure a transport
  41. // for the mailer to send real emails.
  42. 'useFileTransport' => true,
  43. ],
  44. ],
  45. ];
粤ICP备19079148号