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 );