yiiapp/protected/config/main.php 项目配置文件

<?php
//yiiapp/protected/config/main.php 项目总的配置文件



// uncomment the following to define a path alias
// 取消注释以下以下定义一个路径别名
// Yii::setPathOfAlias('local','path/to/local-folder');

   //不知道干什么用的,应该是设置一个名为local的路径
   //Yii::setPathOfAlias('local','path/to/local-folder');

   
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
// 这是主要的Web应用程序配置。任何可写的
// CWebApplication类属性可以配置。

//echo dirname(__FILE__).DIRECTORY_SEPARATOR.'..';
//C:\wamp\www\yiiapp\protected\config\.. 
return array(

    //DIRECTORY_SEPARATOR不用说解释    
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..', //取得项目所在的目录
	'name'=>'My YII Test', //name web的名称 显示的项目前名称

	// preloading 'log' component 预压'日志'组件
	'preload'=>array('log'),

	// autoloading model and component classes
	// 自动加载模型和组件类
	// 自动加载模型和组件类的地方
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	
	'modules'=>array(
		// uncomment the following to enable the Gii tool
		// 取消注释,使GII工具
		// GII是自动生成CDEV
		/*
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'Enter Your Password Here',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		*/
	    'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'123456',
	    ),
	),

	// application components
	// 应用程序组件
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			// 启用基于cookie的认证
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
		// 继取消注释启用的URL路径格式
		/*
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		*/
		
		
		
		/*'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),*/
		// uncomment the following to use a MySQL database		
		// 数据库访问配置
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=yiitest',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),

		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			// 使用'站点/错误'行动的显示错误
			'errorAction'=>'site/error',
		),
		
		
		//log的日志配置
		'log'=>array(
			'class'=>'CLogRouter', //类名
			'routes'=>array( //路线
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				// 取消注释以下的以下网页上显示日志信息,
				// 哦在页面上直接显示日志信息,好方法
				array(
					'class'=>'CWebLogRoute',
				),
			),
		),
	),

	// 应用程序级的参数,也可以访问 
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		// 这是用来在联系人页面...
		'adminEmail'=>'webmaster@example.com',
	),
);

  

posted @ 2013-06-22 17:31  简单--生活  阅读(463)  评论(0)    收藏  举报
简单--生活(CSDN)