<?php

// Set the path of Bootstrap to be the root of the project.
//Yii::setPathOfAlias('bootstrap', realpath(dirname(__FILE__).'/../../../'));

$config = array(
    'basePath'=>realpath(dirname(__FILE__).'/..'),
    'timeZone' => 'America/Mexico_City',
    'name'=>'RIR - Observatorio de datos',

    'preload'=>array(
        'bootstrap',
        'log',
    ),

    'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.modules.user.models.*',
        'application.modules.user.components.*',
    ),

    'modules'=>array(
        'panel',
	    'CyT',

	    'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'pass',
            'ipFilters'=>false,
            'generatorPaths'=>array('bootstrap.gii'),
        ),


    ),

    'components'=>array(
        'funciones'=>array(
            'class'=>'Funciones',
            'someconfig'=>'someothervalue',
        ),
        'bootstrap'=>array(
            'class'=>'ext.bootstrap.components.Bootstrap',
            'responsiveCss'=>false,
        ),
        'user'=>array(
            // enable cookie-based authentication
            'class' => 'WebUser',
            'allowAutoLogin'=>true,
            'loginUrl' => array('panel/acceso/login'),
        ),
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=PPD',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => 'PkJXPQFykKLmS3cWhqmZKNYE',
            'charset' => 'utf8',
            'tablePrefix' => 'tbl_',
        ),
        'errorHandler'=>array(
            'errorAction'=>'site/error',
        ),
        /*'fb'=>array(
            'class'=>'ext.facebook.components.FacebookConnect',
            'appID'=>'106265262835735',
            'appNamespace'=>'yii-bootstrap',
        ),*/
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'trace, info, error, warning, vardump',
                ),
                // uncomment the following to show log messages on web pages
                array(
                    'class' => 'CWebLogRoute',
                    'enabled' => YII_DEBUG,
                    'levels' => 'error, warning, trace, notice',
                    'categories' => 'application',
                    'showInFireBug' => false,
                ),
            ),
        ),
        'urlManager'=>array(
            'urlFormat'=>'path',
            'urlSuffix'=>'.html',
            'rules'=>array(
                'index'=>'site/index',
                'setup'=>'site/setup',
            ),
        ),
    ),

    // Application-level parameters
    'params'=>array(
        'appTitle'=>'Red interinstitucional de resiliencia en asuntos hídricos y telúricos para la CDMX',
        'appDescription'=>'Red interinstitucional de resiliencia en asuntos hídricos y telúricos para la CDMX',
    ),
);

return file_exists(dirname(__FILE__).'/local.php')
    ? CMap::mergeArray($config, require('local.php'))
    : $config;