console.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. $params = require __DIR__ . '/params.php';
  3. $rsparams['params'] = require_config('ueditor.php');
  4. $rsparams = array_merge_recursive(require_config('coin.php'), $rsparams);
  5. $rsparams = array_merge_recursive(require_config('commission.php'), $rsparams);
  6. $rsparams = array_merge_recursive(require_config('mailer.php'), $rsparams);
  7. $rsparams = array_merge_recursive(require_config('mapp.php'), $rsparams);
  8. $rsparams = array_merge_recursive(require_config('mp.php'), $rsparams);
  9. $rsparams = array_merge_recursive(require_config('openauth.php'), $rsparams);
  10. $rsparams = array_merge_recursive(require_config('openwx.php'), $rsparams);
  11. $rsparams = array_merge_recursive(require_config('oss.php'), $rsparams);
  12. $rsparams = array_merge_recursive(require_config('pay.php'), $rsparams);
  13. $rsparams = array_merge_recursive(require_config('point.php'), $rsparams);
  14. $params = array_merge($params,$rsparams['params']);
  15. $db = require __DIR__ . '/db.php';
  16. $config = [
  17. 'id' => 'console',
  18. 'controllerNamespace' => 'app\commands',
  19. 'language'=>$params['language'],
  20. 'bootstrap' => ['log'],
  21. //'defaultRoute'=>'user',//设置默认的控制器
  22. 'aliases' => [
  23. '@bower' => '@vendor/bower-asset',
  24. '@npm' => '@vendor/npm-asset',
  25. ],
  26. 'components' => [
  27. 'cache' => [
  28. 'class' => 'yii\caching\FileCache',
  29. ],
  30. 'log' => [
  31. 'targets' => [
  32. [
  33. 'class' => 'yii\log\FileTarget',
  34. 'levels' => ['error', 'warning'],
  35. ],
  36. ],
  37. ],
  38. 'mailer' => [
  39. 'class' => 'yii\swiftmailer\Mailer',
  40. 'viewPath' => BASE_PATH.'mail',
  41. // send all mails to a file by default. You have to set
  42. // 'useFileTransport' to false and configure a transport
  43. // for the mailer to send real emails.
  44. 'useFileTransport' => false,
  45. 'transport' => [
  46. 'class' => 'Swift_SmtpTransport',
  47. 'host' => $params['mailer']['host'],
  48. 'username' => $params['mailer']['username'],
  49. 'password' => $params['mailer']['password'],
  50. 'port' => $params['mailer']['port'],
  51. 'encryption' => $params['mailer']['encryption'],
  52. ],
  53. 'messageConfig'=>[
  54. 'charset'=>'UTF-8',
  55. 'from'=>[$params['mailer']['fromname']=>$params['mailer']['fromtitle']]
  56. ],
  57. ],
  58. ],
  59. 'params' => $params,
  60. ];
  61. if (YII_ENV_DEV) {
  62. // configuration adjustments for 'dev' environment
  63. $config['bootstrap'][] = 'gii';
  64. $config['modules']['gii'] = [
  65. 'class' => 'yii\gii\Module',
  66. ];
  67. }
  68. $config['components'] = array_merge($config['components'],$db);
  69. return $config;