fahmihilmansyah

aa

Sep 28th, 2021 (edited)
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.38 KB | None | 0 0
  1. <?php
  2.  
  3. $params = require __DIR__ . '/params.php';
  4. $db = require __DIR__ . '/db.php';
  5.  
  6. $config = [
  7.     'id' => 'masjidi',
  8.     'timeZone' => 'Asia/Jakarta',
  9.     'basePath' => dirname(__DIR__),
  10.     'bootstrap' => ['log',
  11.         'app\components\ModuleBootstrap',
  12.         'assetsAutoCompress'
  13.         ],
  14.     'aliases' => [
  15.         '@bower' => '@vendor/bower-asset',
  16.         '@npm'   => '@vendor/npm-asset',
  17.     ],
  18.     'components' => [
  19.         'assetsAutoCompress' =>
  20.         [
  21.             'class'         => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
  22.         ],
  23.         'assetManager' => [
  24.             'linkAssets' => true,
  25.         ],
  26.         'request' => [
  27.             // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
  28.             'cookieValidationKey' => 'AQWED32MASJIDI2021@@3#ceeaeIIlks093KKl3d-',
  29.             'csrfCookie' => [
  30.                 'httpOnly' => true,
  31.                 'secure' => false,
  32.             ]
  33.         ],
  34.         'cache' => [
  35.             'class' => 'yii\caching\FileCache',
  36.         ],
  37.  
  38. //        'cache' => [
  39. //            'class' => 'yii\caching\DbCache',
  40. //            'cacheTable' => 'cache',
  41. //        ],
  42.     //    'cookies'=>[
  43.     //        'class'=>'yii\web\Cookie',
  44.     //        'httpOnly'=>true,
  45.     //        'secure'=>true
  46.     //    ],
  47.        'session' => [
  48.            'class' => 'yii\web\DbSession',
  49.            'cookieParams' => [
  50.                'httponly' => true,
  51. //                'lifetime' => 3600 * 4
  52.                'secure'=>true,
  53.            ],
  54.            'timeout' => 3600*24*30, //session expire
  55. //            'useCookies' => true,
  56. //            'sessionTable' => 'session',
  57. //            'savePath' => __DIR__ . '/../runtime',
  58.        ],
  59.        'redis' => [
  60.            'class' => 'yii\redis\Connection',
  61.            'hostname'=>'redis-cluster.gateway.svc.cluster.local',
  62.            'port' => 6379,
  63.            'database' => 0,
  64.            'cookieParams' => ['httponly' => true, 'lifetime' => 3600 * 4],
  65.            'timeout' => 3600*4, //session expire
  66.            'useCookies' => true,
  67.             'db' => 'masjidi',
  68.             'sessionTable' => 'session',
  69.        ],
  70.         'redis' => [
  71.             'class' => 'yii\redis\Connection',
  72.             'hostname' => 'redis-cluster.gateway.svc.cluster.local',
  73. //            'hostname' => '192.168.0.119',
  74.             'port' => 6379,
  75.             'database' => 0,
  76.         ],
  77.         'cache' => [
  78.             'class' => 'yii\redis\Cache',
  79.             'redis' => [
  80.                 'hostname' => 'redis-cluster.gateway.svc.cluster.local',
  81. //                'hostname' => '192.168.0.119',
  82.                 'port' => 6379,
  83.                 'database' => 0,
  84.             ],
  85. //            'timeout' => 3600*4, //session expire
  86.         ],
  87.         'session' => [
  88.             'class' => 'yii\redis\Session',
  89.             'redis' => [
  90. //                'hostname' => '192.168.0.119',
  91.                 'hostname' => 'redis-cluster.gateway.svc.cluster.local',
  92.                 'port' => 6379,
  93.                 'database' => 0,
  94.             ],
  95. //            'cookieParams' => [
  96. //                'httponly' => true,
  97. ////                'secure' => true,
  98. //                'lifetime' => 3600*24*30],
  99. //            'useCookies' => true,
  100.             'timeout' => 3600*24*30, //session expire
  101.         ],
  102.     //    'session' => [
  103.     //        'class' => 'yii\web\Session',
  104.     //        'cookieParams' => ['httponly' => true,'secure' => true, 'lifetime' => 3600 * 4],
  105.     //        'timeout' => 3600*24*30, //session expire
  106.     //        'useCookies' => true,
  107.     //        'savePath' => __DIR__ . '/../runtime',
  108.     //    ],
  109.         'user' => [
  110.             'identityClass' => 'app\models\User',
  111.             'enableAutoLogin' => true,
  112.         ],
  113.         'person' => [
  114.             'class'=>'yii\web\User',
  115.             'identityClass' => 'app\models\Userperson',
  116.             'enableAutoLogin' => true,
  117.         ],
  118.         'guest' => [
  119.             'class'=>'yii\web\User',
  120.             'identityClass' => 'app\models\extra\Userguest',
  121.             'enableAutoLogin' => true,
  122.         ],
  123.         'validator' => [
  124.             'class' => 'Rakit\Validation\Validator'
  125.         ],
  126.         'errorHandler' => [
  127.             'errorAction' => 'site/error',
  128.         ],
  129.         'mailer' => [
  130.             'class' => 'yii\swiftmailer\Mailer',
  131.             // send all mails to a file by default. You have to set
  132.             // 'useFileTransport' to false and configure a transport
  133.             // for the mailer to send real emails.
  134.             'useFileTransport' => true,
  135.         ],
  136.         'log' => [
  137.             'traceLevel' => YII_DEBUG ? 3 : 0,
  138.             'targets' => [
  139.                 [
  140.                     'class' => 'yii\log\FileTarget',
  141.                     'levels' => ['error', 'warning'],
  142.                 ],
  143.             ],
  144.         ],
  145.         'db' => $db,
  146.         /*
  147.         'urlManager' => [
  148.             'enablePrettyUrl' => true,
  149.             'showScriptName' => false,
  150.             'rules' => [
  151.             ],
  152.         ],
  153.         */
  154.  
  155.         'urlManager' => [
  156.             'enablePrettyUrl' => true,
  157.             'showScriptName' => false,
  158.             'rules' => [
  159.                 '' => 'site/index',
  160.                 'login' => 'site/login',
  161.                 'dashboard' => 'site/index',
  162.                 'program-masjid' => 'dkm-program/index',
  163.                 'program-masjid-edit' => 'dkm-program/edit',
  164.                 'program-masjid-create' => 'dkm-program/create',
  165.                 'program-masjid-list' => 'dkm-program/list',
  166. //                'apis/auth/test' => 'apis/auth/default/test',
  167.                 'campaign/search/<q:[\w ]+>' => 'campaign/search',
  168.                 'campaign/categories/<k:\d+>' => 'campaign/search',
  169.                 'trxipg/success/<id:\w+>'=>'trxipg/default/success',
  170.                 'trxipg/failed/<id:\w+>'=>'trxipg/default/failed',
  171.                 'trxipg/return/<id:\w+>'=>'trxipg/default/return',
  172.                 'myqr/success/<id:\w+>'=>'trxipg/myqr/success',
  173.                 'myqr/failed/<id:\w+>'=>'trxipg/myqr/failed',
  174.                 'myqr/return/<id:\w+>'=>'trxipg/myqr/return',
  175.                 '<controller:\w+>/<id:\d+>' => '<controller>/view',
  176.                 '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
  177.                 '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
  178.             ],
  179.         ],
  180.     ],
  181.     'params' => $params,
  182.     'modules' => [
  183.         'admin' => [
  184.             'class' => 'app\modules\admin\Admin',
  185.             'layout' => '@app/views/layouts/backend'
  186.         ],'trxipg' => [
  187.             'class' => 'app\modules\trxipg\Module',
  188.         ],
  189.         'apis' => [
  190.             'class' => 'app\modules\apis\Module',
  191.         ],
  192.     ],
  193. ];
  194.  
  195. if (YII_ENV_DEV) {
  196.     // configuration adjustments for 'dev' environment
  197.     $config['bootstrap'][] = 'debug';
  198.     $config['modules']['debug'] = [
  199.         'class' => 'yii\debug\Module',
  200.         // uncomment the following to add your IP if you are not connecting from localhost.
  201.         //'allowedIPs' => ['127.0.0.1', '::1'],
  202.     ];
  203.  
  204.     $config['bootstrap'][] = 'gii';
  205.     $config['modules']['gii'] = [
  206.         'class' => 'yii\gii\Module',
  207.         // uncomment the following to add your IP if you are not connecting from localhost.
  208.         //'allowedIPs' => ['127.0.0.1', '::1'],
  209.     ];
  210. }
  211.  
  212. return $config;
  213.  
Add Comment
Please, Sign In to add comment