Yii主配置文件

main.php

  1 <?php
2
3 // uncomment the following to define a path alias
4 // Yii::setPathOfAlias('local','path/to/local-folder');
5
6 // This is the main Web application configuration. Any writable
7 // CWebApplication properties can be configured here.
8 return array(
9 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
10 'name'=>'My Web Application',
11
12 // preloading 'log' component
13 'preload'=>array('log'),
14
15 // autoloading model and component classes
16 'import'=>array(
17 'application.models.*',
18 'application.components.*',
19 ),
20
21 //default controller
22 'defaultController'=>'test',
23
24 //controller map
25 /* 'controllerMap'=>array(
26 'index'=>'application.controllers.TestController',
27 ), */
28
29 'modules'=>array(
30 // uncomment the following to enable the Gii tool
31
32 'gii'=>array(
33 'class'=>'system.gii.GiiModule',
34 'password'=>'mr.coke',
35 // If removed, Gii defaults to localhost only. Edit carefully to taste.
36 'ipFilters'=>array('127.0.0.1','::1'),
37 ),
38
39 ),
40
41 // application components
42 'components'=>array(
43 'user'=>array(
44 // enable cookie-based authentication
45 'allowAutoLogin'=>true,
46 ),
47 // uncomment the following to enable URLs in path-format
48
49 'urlManager'=>array(
50 'urlFormat'=>'path',
51 'rules'=>array(
52 '<controller:\w+>/<id:\d+>'=>'<controller>/view',
53 '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
54 '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
55 'index'=>'test/index',
56 'test'=>'test/test',
57 ),
58 ),
59
60 /* 'db'=>array(
61 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
62 ), */
63 // uncomment the following to use a MySQL database
64
65 'db'=>array(
66 'connectionString' => 'mysql:host=localhost;dbname=user.login.yii',
67 'emulatePrepare' => true,
68 'username' => 'root',
69 'password' => 'root',
70 'charset' => 'utf8',
71 'tablePrefix' =>'tbl_',
72 'enableProfiling'=>YII_DEBUG,
73 'enableParamLogging'=>YII_DEBUG,
74 ),
75
76 'errorHandler'=>array(
77 // use 'site/error' action to display errors
78 'errorAction'=>'site/error',
79 ),
80 'log'=>array(
81 'class'=>'CLogRouter',
82 'routes'=>array(
83 array(
84 'class'=>'CFileLogRoute',
85 'levels'=>'error, warning',
86 ),
87 // uncomment the following to show log messages on web pages
88
89 array(
90 'class'=>'CWebLogRoute',
91 'levels'=>'error, warning,trace',
92 'categories'=>'system.db.*',
93 ),
94
95 ),
96 ),
97 ),
98
99 // application-level parameters that can be accessed
100 // using Yii::app()->params['paramName']
101 'params'=>array(
102 // this is used in contact page
103 'adminEmail'=>'webmaster@example.com',
104 ),
105 );



转载于:https://www.cnblogs.com/mrcoke/articles/2357600.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值