Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $params = require __DIR__ . '/params.php';
- $db = require __DIR__ . '/db.php';
- $config = [
- 'id' => 'masjidi',
- 'timeZone' => 'Asia/Jakarta',
- 'basePath' => dirname(__DIR__),
- 'bootstrap' => ['log',
- 'app\components\ModuleBootstrap',
- 'assetsAutoCompress'
- ],
- 'aliases' => [
- '@bower' => '@vendor/bower-asset',
- '@npm' => '@vendor/npm-asset',
- ],
- 'components' => [
- 'assetsAutoCompress' =>
- [
- 'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
- ],
- 'assetManager' => [
- 'linkAssets' => true,
- ],
- 'request' => [
- // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
- 'cookieValidationKey' => 'AQWED32MASJIDI2021@@3#ceeaeIIlks093KKl3d-',
- 'csrfCookie' => [
- 'httpOnly' => true,
- 'secure' => false,
- ]
- ],
- 'cache' => [
- 'class' => 'yii\caching\FileCache',
- ],
- // 'cache' => [
- // 'class' => 'yii\caching\DbCache',
- // 'cacheTable' => 'cache',
- // ],
- // 'cookies'=>[
- // 'class'=>'yii\web\Cookie',
- // 'httpOnly'=>true,
- // 'secure'=>true
- // ],
- 'session' => [
- 'class' => 'yii\web\DbSession',
- 'cookieParams' => [
- 'httponly' => true,
- // 'lifetime' => 3600 * 4
- 'secure'=>true,
- ],
- 'timeout' => 3600*24*30, //session expire
- // 'useCookies' => true,
- // 'sessionTable' => 'session',
- // 'savePath' => __DIR__ . '/../runtime',
- ],
- 'redis' => [
- 'class' => 'yii\redis\Connection',
- 'hostname'=>'redis-cluster.gateway.svc.cluster.local',
- 'port' => 6379,
- 'database' => 0,
- 'cookieParams' => ['httponly' => true, 'lifetime' => 3600 * 4],
- 'timeout' => 3600*4, //session expire
- 'useCookies' => true,
- 'db' => 'masjidi',
- 'sessionTable' => 'session',
- ],
- 'redis' => [
- 'class' => 'yii\redis\Connection',
- 'hostname' => 'redis-cluster.gateway.svc.cluster.local',
- // 'hostname' => '192.168.0.119',
- 'port' => 6379,
- 'database' => 0,
- ],
- 'cache' => [
- 'class' => 'yii\redis\Cache',
- 'redis' => [
- 'hostname' => 'redis-cluster.gateway.svc.cluster.local',
- // 'hostname' => '192.168.0.119',
- 'port' => 6379,
- 'database' => 0,
- ],
- // 'timeout' => 3600*4, //session expire
- ],
- 'session' => [
- 'class' => 'yii\redis\Session',
- 'redis' => [
- // 'hostname' => '192.168.0.119',
- 'hostname' => 'redis-cluster.gateway.svc.cluster.local',
- 'port' => 6379,
- 'database' => 0,
- ],
- // 'cookieParams' => [
- // 'httponly' => true,
- //// 'secure' => true,
- // 'lifetime' => 3600*24*30],
- // 'useCookies' => true,
- 'timeout' => 3600*24*30, //session expire
- ],
- // 'session' => [
- // 'class' => 'yii\web\Session',
- // 'cookieParams' => ['httponly' => true,'secure' => true, 'lifetime' => 3600 * 4],
- // 'timeout' => 3600*24*30, //session expire
- // 'useCookies' => true,
- // 'savePath' => __DIR__ . '/../runtime',
- // ],
- 'user' => [
- 'identityClass' => 'app\models\User',
- 'enableAutoLogin' => true,
- ],
- 'person' => [
- 'class'=>'yii\web\User',
- 'identityClass' => 'app\models\Userperson',
- 'enableAutoLogin' => true,
- ],
- 'guest' => [
- 'class'=>'yii\web\User',
- 'identityClass' => 'app\models\extra\Userguest',
- 'enableAutoLogin' => true,
- ],
- 'validator' => [
- 'class' => 'Rakit\Validation\Validator'
- ],
- 'errorHandler' => [
- 'errorAction' => 'site/error',
- ],
- 'mailer' => [
- 'class' => 'yii\swiftmailer\Mailer',
- // 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,
- ],
- 'log' => [
- 'traceLevel' => YII_DEBUG ? 3 : 0,
- 'targets' => [
- [
- 'class' => 'yii\log\FileTarget',
- 'levels' => ['error', 'warning'],
- ],
- ],
- ],
- 'db' => $db,
- /*
- 'urlManager' => [
- 'enablePrettyUrl' => true,
- 'showScriptName' => false,
- 'rules' => [
- ],
- ],
- */
- 'urlManager' => [
- 'enablePrettyUrl' => true,
- 'showScriptName' => false,
- 'rules' => [
- '' => 'site/index',
- 'login' => 'site/login',
- 'dashboard' => 'site/index',
- 'program-masjid' => 'dkm-program/index',
- 'program-masjid-edit' => 'dkm-program/edit',
- 'program-masjid-create' => 'dkm-program/create',
- 'program-masjid-list' => 'dkm-program/list',
- // 'apis/auth/test' => 'apis/auth/default/test',
- 'campaign/search/<q:[\w ]+>' => 'campaign/search',
- 'campaign/categories/<k:\d+>' => 'campaign/search',
- 'trxipg/success/<id:\w+>'=>'trxipg/default/success',
- 'trxipg/failed/<id:\w+>'=>'trxipg/default/failed',
- 'trxipg/return/<id:\w+>'=>'trxipg/default/return',
- 'myqr/success/<id:\w+>'=>'trxipg/myqr/success',
- 'myqr/failed/<id:\w+>'=>'trxipg/myqr/failed',
- 'myqr/return/<id:\w+>'=>'trxipg/myqr/return',
- '<controller:\w+>/<id:\d+>' => '<controller>/view',
- '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
- '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
- ],
- ],
- ],
- 'params' => $params,
- 'modules' => [
- 'admin' => [
- 'class' => 'app\modules\admin\Admin',
- 'layout' => '@app/views/layouts/backend'
- ],'trxipg' => [
- 'class' => 'app\modules\trxipg\Module',
- ],
- 'apis' => [
- 'class' => 'app\modules\apis\Module',
- ],
- ],
- ];
- if (YII_ENV_DEV) {
- // configuration adjustments for 'dev' environment
- $config['bootstrap'][] = 'debug';
- $config['modules']['debug'] = [
- 'class' => 'yii\debug\Module',
- // uncomment the following to add your IP if you are not connecting from localhost.
- //'allowedIPs' => ['127.0.0.1', '::1'],
- ];
- $config['bootstrap'][] = 'gii';
- $config['modules']['gii'] = [
- 'class' => 'yii\gii\Module',
- // uncomment the following to add your IP if you are not connecting from localhost.
- //'allowedIPs' => ['127.0.0.1', '::1'],
- ];
- }
- return $config;
Add Comment
Please, Sign In to add comment