<?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.
return array(
	'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
	'name' => 'Aplikasi Penilaian Video',
	'theme' => 'beagle',
	'timeZone' => 'Asia/Jakarta',
	'language' => 'id',

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

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

	'modules' => array(
		'gii' => array(
			'class' => 'system.gii.GiiModule',
			'password' => false,
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters' => array('127.0.0.1', '::1', '192.168.43.*'),
		),

	),

	// application components
	'components' => array(


		'mail' => array(
			'class' => 'ext.yii-mail.YiiMail',
			'transportType' => 'smtp',
			'transportOptions' => array(
				// 'encryption' => 'ssl',
				// 'host' => 'smtp.gmail.com',
				// 'username' => 'balitbanghub.chat@gmail.com',
				// 'password' => 'new-Balitbanghub2019',
				// 'port' => 465,
				'encryption'=>'tls',
				'host'=>'mail.bandungkab.go.id',
				'username'=>'notifikasi@bandungkab.go.id',
				'password'=>'masuk*12345',
				'port'=>587,
			),
			'viewPath' => 'application.views.mail',
			'logging' => true,
			'dryRun' => false
		),

		'user' => array(
			// enable cookie-based authentication
			'allowAutoLogin' => true,
		),

		// uncomment the following to enable URLs in path-format
		// 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>',

				//Page URL Default Settings
				'login' => 'site/login',
				'logout' => 'site/logout',
				'dashboard' => 'site/dashboard',
				'home' => 'site/home',
				'index' => 'site/index',

				//Page URL Activation and Reset
				'reset/<token:[a-zA-Z0-9-]+>/' => 'site/reset',
				'activation/<token:[a-zA-Z0-9-]+>/' => 'site/activation',
				'register-individu' => 'site/register/jenis/1',
				'register-team' => 'site/register/jenis/2',
				'register' => 'site/register',

				//Profile
				'/member/<name:[a-zA-Z0-9-]+>/' => 'integration/users/member',
				'/indicator/' => 'master/sub/list/id/1',
				'/profile' => 'integration/users/profile',
				'/edit' => 'integration/users/editprofile',
				'/file' => 'integration/users/file',
				'/password' => 'integration/users/password',

			),

			'showScriptName' => false,
			'caseSensitive' => false,
			// 'urlSuffix'=>'.aspx'
		),

		// database settings are configured in database.php
		// 'db'=>require(dirname(__FILE__).'/database.php'),

		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=sinerjiteknoindo_lombakaryatulis',
			'initSQLs'=>array("set time_zone='+07:00';"),
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),


		// 'db' => array(
			// 	'connectionString' => 'mysql:host=localhost;dbname=videolomba',
			// 	'initSQLs' => array("set time_zone='+07:00';"),
			// 	'emulatePrepare' => true,
			// 	'username' => 'videolomba',
			// 	'password' => 'masuk*12345',
			// 	'charset' => 'utf8',
			// ),

		'errorHandler' => array(
				// use 'site/error' action to display errors
			'errorAction' => YII_DEBUG ? null : 'site/error',
				// 'errorAction' => 'site/error'
		),

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