<?php
$params = array_merge(
	require __DIR__ . '/../../common/config/params.php' ,
	require __DIR__ . '/../../common/config/params-local.php' ,
	require __DIR__ . '/params.php' ,
	require __DIR__ . '/params-local.php'
);

return [
	'id'                  => 'app-mobile' ,
	'basePath'            => dirname( __DIR__ ) ,
	'bootstrap'           => [ 'log' ] ,
	'modules'             => [
		'live' => [
			'class'    => 'mobile\modules\live\Module' ,
			'viewPath' => "@app/modules/live/views" ,
			'layout'   => 'main' ,
		] ,
	] ,
	'controllerNamespace' => 'mobile\controllers' ,
	'components'          => [
		'request'      => [
			'csrfParam' => 'csrf_token_m' ,
		] ,
		'user'         => [
			'identityClass'   => 'common\models\User' ,
			'enableAutoLogin' => true ,
			'identityCookie'  => [ 'name' => '_identity-mobile' , 'httpOnly' => true ] ,
		] ,
		'session'      => [
			// this is the name of the session cookie used for login on the frontend
			'name' => 'advanced-mobile' ,
		] ,
		'hostserver'   => [
			'class' => 'common\api\HostServer' ,
		] ,
		'log'          => [
			'traceLevel' => YII_DEBUG ? 3 : 0 ,
			'targets'    => [
				[
					'class'  => 'yii\log\FileTarget' ,
					'levels' => [ 'error' , 'warning' ] ,
				] ,
				//                [
				//                    'class' => 'yii\log\FileTarget',
				//                    'levels' => ['error', 'warning','info'],
				//                    'logVars'=>[],
				//                    //表示以yii\db\或者app\models\开头的分类都会写入这个文件
				//                    'categories'=>['yii\db\*','common\models\*'],
				//                    //表示写入到文件sql.log中年月日记录日志
				//                    'logFile'=>'@runtime/../logs/sql/sql.log'.date('Ymd'),
				//                ]
			] ,
		] ,
		'errorHandler' => [
			'errorAction' => 'public/error' ,
		] ,
		'assetManager' => [
			//            'class' => 'yii\web\AssetManager',
			//            'appendTimestamp' => true,
			//            'forceCopy' => true,
			'bundles' => [
				//                'linkAssets' => true,
				'yii\web\YiiAsset' => [
					'js'         => [] ,  // 去除 yii.js
					'sourcePath' => null ,  // 防止在 frontend/web/asset 下生产文件
				] ,
				
				'yii\widgets\ActiveFormAsset' => [
					'js'         => [] ,  // 去除 yii.activeForm.js
					'sourcePath' => null ,  // 防止在 frontend/web/asset 下生产文件
				] ,
				
				'yii\validators\ValidationAsset'     => [
					'js'         => [] ,  // 去除 yii.validation.js
					'sourcePath' => null ,  // 防止在 frontend/web/asset 下生产文件
				] ,
				//                'yii\bootstrap\BootstrapAsset' => [
				//                    'css' => [],  // 去除 bootstrap.css
				//                    'sourcePath' => null, // 防止在 frontend/web/asset 下生产文件
				//                ],
				'yii\bootstrap\BootstrapPluginAsset' => [
					'js'         => [] ,  // 去除 bootstrap.js
					'sourcePath' => null ,  // 防止在 frontend/web/asset 下生产文件
				] ,
				'yii\web\JqueryAsset'                => [
					'js'         => [] ,  // 去除 jquery.js
					'sourcePath' => null ,  // 防止在 frontend/web/asset 下生产文件
				] ,
			] ,
		] ,
		
		'urlManager' => [
			'enablePrettyUrl' => true ,
			'showScriptName'  => false ,
			//            'enableStrictParsing' => true,
			'rules'           => [
				'/'                                        => 'index/index' ,
				'/mobile<t:(/|)>'                          => 'index/index' ,
				'/house/search<t:(/|)>'                    => '/house/search' ,
				'/house/abroad<t:(/|)>'                    => '/house/abroad' ,
				'/house/searchdatas'                       => '/house/searchdatas' ,
				'/house/searchdata'                        => '/house/searchdata' ,
				'/house/soncity'                           => '/house/soncity' ,
				'/house/news/<hid:\w+><t:(/|)>'            => '/house/news' ,
				'/house/type/<hid:\w+><t:(/|)>'            => '/house/type' ,
				'/house/details/<hid:\w+><t:(/|)>'         => '/house/details' ,
				'/house/periphery/<hid:\w+>'               => '/house/periphery' ,
				'/house/album/<hid:\w+><t:(/|)>'           => '/house/album' ,
				'/house/remarkfrom'                        => "house/remarkfrom" ,
				'/house/houseremark/<hid:\w+><t:(/|)>'     => "/house/houseremark" ,
				'/house/houseloadremark/<hid:\w+><t:(/|)>' => "/house/houseloadremark" ,
				'/house/remarklikesfrom'                   => '/house/remarklikesfrom' ,
				'/house/remark/<hid:\w+><t:(/|)>'          => '/house/remark' ,
				'/house/remarkdetails/<hid:\w+><t:(/|)>'   => '/house/remarkdetails' ,
				'/house/dynamic'                           => '/house/dynamic' ,
				'/house/housetype'                         => '/house/housetype' ,
				'/house/housetypeall'                      => '/house/housetypeall' ,
				'/house/albumlist'                         => '/house/albumlist' ,
				'/house/tall'                              => '/house/tall' ,
				'/house/selftel/<hid:\w+><t:(/|)>'         => "/house/selftel" ,
				'/house/houseprice'                        => '/house/houseprice' ,
				'/house/peitao/<hid:\w+>'                  => '/house/peitao' ,
				'/house/searchname'                        => '/house/searchname' ,
				'/about/company'                           => '/about/company' ,//关于我们
				'/about/contact'                           => '/about/contact' ,//联系我们
				'/house/licence'                           => '/house/licence' ,
				'/news/details/<nid:\w+><t:(/|)>'          => '/news/details' ,
				'/video/videodetails/<hid:\w+><t:(/|)>'    => '/video/videodetails' ,
				'/villa/villalist<t:(/|)>'                 => '/villa/villalist' ,
				//                '/house/<hid:\w+><t:(/|)>' => '/house/home',
				'/house/<hid:><t:(/|)>'                    => '/house/home' ,
				//'/house/loan' => '/house/loan',
				
				'/house/pvimage/<hid:\w+><t:(/|)>' => '/house/pvimage' ,  //  相册放大浏览页面
				'/house/hximage/<hid:\w+><t:(/|)>' => '/house/hximage' ,  //  户型放大浏览页面
				'/house/zhongqu/<hid:>'            => '/house/zhongqu' ,  //众趣播放页面
				
				'/house/loan/<hid:><t:(/|)>'               => '/house/loan' ,
				'/house/intro/<hid:><t:(/|)>'              => '/house/intro' ,
				'/knowledgebase/details/<nid:\w+><t:(/|)>' => '/knowledgebase/details' ,
				'/knowledgebase/list<t:(/|)>'              => '/knowledgebase/list' ,
				'/knowledgebase/<t:(/|)>'                  => '/knowledgebase/index' ,
				'/news/homeform'                           => '/news/homeform' ,
				'/news/<cid:(\w+|/|)><t:(/|)>'             => '/news/home' ,
				
				'/public/filtrate<t:(/|)>'                 => '/public/filtrate' ,
				'/public/searchalertwindow<t:(/|)>'        => '/public/searchalertwindow' ,
				
				//奇葩说
				'/weirdo/details<t:(/|)><qid:\w+><r:(/|)>' => '/weirdo/details' ,
				
				'/weirdo<t:(/|)>' => '/weirdo/home' ,
				
				'/pj/details/<pid:\w+><t:(/|)>' => '/pj/details' ,
				'/pj/homeform'                  => 'pj/homeform' ,
				'/pj<t:(/|)>'                   => '/pj/home' ,
				'/wap<t:(/|)>'                  => '/wap/index' ,
				
				'<controller:\w+>/<action:\w+>'      => '<controller>/<action>' ,
				'<controller:\w+>/<action:\w+>.html' => '<controller>/<action>' ,
				'<controller:\w+>/<action:\w+>.php'  => '<controller>/<action>' ,
			] ,
		] ,
	
	] ,
	'params'              => $params ,
	'language'            => 'zh-CN' ,
];