| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- // 根据运行环境加载不同的配置文件
- if (YII_ENV_DEV) {
- $mainConfig = require_once __DIR__ . '/config-development.php';
- } else if (YII_ENV_TEST) {
- $mainConfig = require_once __DIR__ . '/config-test.php';
- } else if (YII_ENV_PROD) {
- $mainConfig = require_once __DIR__ . '/config-product.php';
- }
- return [
- 'language' => 'en',
- 'timeZone' => 'Africa/Lagos',
- 'aliases' => [
- '@bower' => '@vendor/bower-asset',
- '@npm' => '@vendor/npm-asset',
- // 'anlity/swooleAsyncTimer' => '@backend/runtime/tmp-extensions/yii2-swoole-async-timer',
- ],
- 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
- 'components' => [
- 'db' => array_merge([
- 'class' => 'yii\db\Connection',
- 'enableSlaves' => false,
- // 'enableSavepoint' => false,
- ], $mainConfig['db'], $mainConfig['slavesDb']),
- // 'dbShop' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema']], $mainConfig['dbShop']),
- 'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
- 'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
- // 'dbShopCalc' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema'],], $mainConfig['dbShopCalc']),
- 'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
- // 'cache' => [
- // //'class' => 'yii\caching\FileCache',
- // 'class' => 'dcb9\redis\Cache',
- // 'redis' => $mainConfig['cacheRedis'],
- // ],
- 'cache' => [
- 'class' => 'yii\redis\Cache',
- 'redis' => $mainConfig['cacheRedis'],
- // 'redis' => [
- // 'hostname' => '127.0.0.1',
- // 'port' => 6379,
- // 'database' => 0,
- // ]
- ],
- 'tokenRedis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['tokenRedis']),
- 'redis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['otherRedis']),
- // 'tokenRedis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['tokenRedis']),
- // 'redis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['otherRedis']),
- 'mailer' => [
- 'class' => 'yii\swiftmailer\Mailer',
- 'viewPath' => '@common/mail',
- // send all mails to a file by default. You have to set
- // 'useFileTransport' to false and configure a transport
- // for the mailer to send real emails.
- 'useFileTransport' => true,
- ],
- 'swooleAsyncTimer' => [
- 'class' => 'common\components\SwooleAsyncTimer',
- ],
- // payStack配置
- 'Paystack' => [
- 'class' => 'smladeoye\paystack\Paystack',
- 'environment' => YII_ENV,
- 'testPublicKey' => 'pk_test_2eed10135c4a958c5073795b22854ded9d1a6c55',
- 'testSecretKey' => 'sk_test_5ece72377432376f5cf6bb5c468395a650220309',
- 'livePublicKey' => 'pk_live_fae524f9d073d877beeb661fd825a37a9bc91f0a',
- 'liveSecretKey' => 'sk_live_b93c6bbee2cc0e9c594547bf4779ec9852b9d055',
- ],
- // 配置SQL语句输出
- 'log' => [
- 'traceLevel' => YII_DEBUG ? 3 : 0,
- 'targets' => [
- [
- 'class' => 'yii\log\FileTarget',
- 'levels' => ['error', 'warning', 'info'],
- 'categories' => ['yii\db\*', 'app\models\*'],
- 'logFile' => '@runtime/logs/sql.log',
- ],
- 'db' => [ 'class' => 'yii\log\FileTarget'],
- ],
- ],
- ],
- 'controllerMap' => [
- 'swoole_server' => [
- 'class' => 'anlity\swooleAsyncTimer\SwooleAsyncTimerController',
- ],
- ],
- ];
|