<?php
/**
 * ThunderSnarf
 *
 * @author Ricardo H.F. Sette P. <ricardohfsp@gmail.com>
 * @link http://www.freebsdbrasil.com.br/
 * @copyright Copyright &copy; 2010 - FreeBSD Brasil LTDA
 * @license licença GNU/GPL v2.0 http://www.gnu.org/licenses/gpl-2.0.html
 */
?>
<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
include_once(dirname(__FILE__).DIRECTORY_SEPARATOR."thundersnarf.conf.php");

return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'ThunderSnarf',
	'sourceLanguage'=>'pt-br',
	'language'=>'pt',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.extensions.yiidebugtb.*', //our extension
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format		
		'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' => 'pgsql:host='.$thundersnarf_conf["DBHOST"].';port='.$thundersnarf_conf["PORT"].';dbname='.$thundersnarf_conf["DBNAME"].'',
			'emulatePrepare' => true,
			'username' => $thundersnarf_conf["DBUSERNAME"],
			'password' => $thundersnarf_conf["DBPASSWORD"],
			'charset' => 'utf8',
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
                        'errorAction'=>'site/error',
                ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				array( // configuration for the toolbar
                                        'class'=>'XWebDebugRouter',
                                        'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle',
                                        'levels'=>'error, warning, trace, profile, info',
                                ),
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'defaultPageSize'=>5,
		'thunderconf'=>$thundersnarf_conf["THUNDERCONF"],
	),
);