main.php 1.52 KB
<?php
return [
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'components' => [
        'fileCache' => [
            'class' => 'yii\caching\FileCache',
            'keyPrefix' => 'YOHOLive:',
        ],
        'cache' => [
            'class' => 'common\components\pagecache\Redis',
            'redis' => 'redis',
            'keyPrefix' => 'YOHOLive:',
        ],
        'redis' => [
            'class' => 'common\components\caching\RedisCache',
            'hostname' => '123.56.138.21',
            'password' => 'yohoglobal',
            'port' => 6379,
            'connectionTimeout' => 0.5,
            'dataTimeout' => 0.8,
        ],
        'redisIm' => [
            'class' => 'common\components\caching\RedisCache',
            'hostname' => '123.56.138.21',
            'password' => 'yohoglobal',
            'port' => 6379,
        ],
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=yii2advanced',
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
            'schemaCache' => 'cache',
            'queryCache' => 'cache',
            'attributes' => [
                \PDO::ATTR_TIMEOUT => 0.8,
            ],
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                //'<controller:\w+>/<action:\w+>/<id:[\d-]+>' => '<controller>/<action>',
            ],
        ],
    ],
    'defaultRoute'=>'index/index',
];