Skip to content

Instantly share code, notes, and snippets.

@jacksontong
Created March 10, 2016 05:45
Show Gist options
  • Save jacksontong/0f872c95f764e0b6dc43 to your computer and use it in GitHub Desktop.
Save jacksontong/0f872c95f764e0b6dc43 to your computer and use it in GitHub Desktop.
yii2 config
return [
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'frontend\controllers',
'language' => 'en-AU',
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'extensions' => require(__DIR__ . '/../../vendor/yiisoft/extensions.php'),
'defaultRoute' => 'site/dashboard',
'components' => [
'assetManager' => [
'bundles' => [
'yii\bootstrap\BootstrapAsset' => [
'sourcePath' => '@webroot/themes/pvsell',
'css' => ['a' => 'css/bootstrap.min.css']
],
],
],
'view' => [
'class' => 'frontend\components\PvsellView',
'theme' => [
'pathMap' => ['@frontend/views' => '@web/themes/pvsell/views'],
'baseUrl' => '@web/themes/pvsell',
],
],
'session' => [
'class' => 'yii\web\Session',
'cookieParams' => ['lifetime' => 3600 * 24 * 30],
'timeout' => 65535
],
'db' => [ // default production db
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=pvsell',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'tablePrefix' => 'snap_',
],
'dbold' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=pvsell.com.au;dbname=pvsell_main',
'username' => 'pvsell_general',
'password' => 'harmony',
'charset' => 'utf8',
//'tablePrefix' => 'snap_',
],
'dbstatic' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=pvsell_static2',
'username' => 'pvsell_general',
'password' => 'as6aXv978',
'charset' => 'utf8',
//'tablePrefix' => 'snap_',
],
'authManager' => [
'class' => 'frontend\modules\pvsell\rbac\DbManager',
],
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'YEFf_GGP8N16VbyBfy26oTTYWwzTxBzP',
],
'user' => [
'class' => 'frontend\components\WebUser',
'identityClass' => 'frontend\modules\pvsell\models\User',
'enableAutoLogin' => true,
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'content/<page:[a-zA-Z0-9-]+>' => 'content/view',
],
],
'formatter' => [
'class' => 'frontend\components\Formatter',
'currencyCode' => 'AUD'
],
'urlManagerBackend' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'baseUrl' => '/admin/',
'rules' => [
'<controller:\w+>/<action:\w+>' => '<controller>/<action>'
],
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment