<?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 . '..',
    'defaultController' => 'Site',
    'name' => 'MyPC',
    'sourceLanguage' => 'en_US',
    'language' => 'en',
    'charset' => 'UTF-8',
    // preloading 'log' component
    'preload' => array('log'),
    // autoloading model and component classes 
    'import' => array(
        'application.models.*',
        'application.models.forms.*',
        'application.components.*',
        'ext.YiiMailer.YiiMailer',
        'application.helpers.*',
    ),
    // application components
    'components' => array(
        'browser' => array(
            'class' => 'application.extensions.browser.CBrowserComponent',
        ),
        /*'geoip' => array(
            'class' => 'application.extensions.geoip.CGeoIP',
            // specify filename location for the corresponding database
            'filename' => $_SERVER["DOCUMENT_ROOT"] . '/protected/extensions/geoip/GeoIP.dat', //GeoIP.dat  GeoLiteCity.dat  GeoIPv6.dat
            // Choose MEMORY_CACHE or STANDARD mode
            'mode' => 'STANDARD',
        ),*/
        'geoip' => array(
            'class' => 'application.components.Reader',
        ),
        'sass' => array(
            // Path to the SassHandler class
            'class' => 'ext.yii-sass.SassHandler',

            // Path and filename of scss.inc.php
            'compilerPath' => __DIR__ . '/../vendor/scssphp/scss.inc.php',

            // Enable Compass support, defaults to false
            'enableCompass' => false,
        ),
        /* 'wlParams' => array(
          'class' => 'application.extensions.wlParams.wlParams',
          ), */
        'clientScript' => array(
            'class' => 'ext.ExtendedClientScript.ExtendedClientScript',
        //   'combineCss'=>true,
        //  'compressCss'=>true,
        //   'combineJs'=>true,
        //   'compressJs'=>true,
        ),
        'Pdf' => array(
            'class' => 'Pdf',
        ),
        'curl' => array(
            'class' => 'Curl',
        ),
        'newsDb' => array(
            'class'            => 'CDbConnection',
            //'connectionString' => 'mysql:host=mps.bmfn.net;port=3306;dbname=newsdb;connect_timeout=5',
            'connectionString' => 'mysql:host=mps_new.bmfn-solutions.com;port=3306;dbname=newsdb;connect_timeout=5',
            'username'         => 'pc_news',
            'password'         => 'C39X2xm$19Q',
            'charset'          => 'utf8',
            'emulatePrepare'   => true,
        ),
        'curlWithHeaders' => array(
            'class' => 'Curl2',
        ),
        'image' => array(
            'class' => 'application.extensions.image.CImageComponent',
            // GD or ImageMagick
            'driver' => 'GD',
            // ImageMagick setup path
            'params' => array('directory' => '/opt/local/bin'),
        ),
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
            'class' => 'WebUser',
        ),
        'authManager' => array(
            'class' => 'PhpAuthManager',
        ),
        'request' => array(
            'class' => 'HttpRequest',
        ),
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'urlManager' => array(
            'showScriptName' => false,
            'urlFormat' => 'path',
            'rules' => array(
                // стандартное правило для обработки '/' как 'site/index'
                '' => 'site/index',
                '/index.html' => 'site/index',
                //'' => 'ib/index',
                // стандартное правило для обработки '/login' как 'site/login' и т.д.
                //site
                '<action:(login|logout|forgot|supportCenter|certificate|about|download|affiliate|openLive|openDemo|activateAccaunt|accountOverview|errorIE7|geoIp|serverError|imgRedirect|inatecTrans|wPaintUpload|cashuTransReturn|dinpayTrans|dcpayTrans|skrillTrans|neoTransSuccess|neoTransError|transaction|echoSignValidation|saveTrAgreeEchoSigns|echoText|getDocument|userList|createUser|leadList|getAvUserPlatforms|assignUser|openUserAcc|addNewLead|addNewUser|emailDelivery|exportUsersToExcel|changeBonusForUser|whatsNew|checkDates|bfopayNotify|bfopayPage|addComment|getComments|paymentReport|autochartist|saveFromPhone|mobileDetect|netellerNotify|eMerchantPayNotify|sovviPayTrans|cache|sandPayTrans|changeFlag|message|reloadCapcha|interestFree|paymentPolicy|mailWebhook)>' => array('site/<action>', 'urlSuffix' => '.html'),
                'login/<type:.*?>' => array('site/login', 'urlSuffix' => '.html'),
                '<type:(whiteLabelUT|whiteLabelMT)>' => array('ib/whiteLabel_full', 'urlSuffix' => '.html'), ####
                #'<type:(whiteLabelUT|whiteLabelMT|whiteLabelACT)>' => array('ib/whiteLabel_full', 'urlSuffix' => '.html'),
                #'<type:(omnibusUT|omnibusMT)>' => array('ib/omnibus_full', 'urlSuffix' => '.html'),
                '<type:(registration|registrationIb|registrationClient)>' => array('site/registration', 'urlSuffix' => '.html'),
                '/188' => array('site/registration', 'urlSuffix' => '.html', 'defaultParams' => array('source' => 13)),
                '/<action:(dinpayTransferRequest|dinpayTransferResult|bfopayWithdrawalRequest|withdrawalZotapayRequest|UserPaymentRedirect|deposit|bfopayCheckWithdrawalStatus|makeDeposit|zotopayTrans|ewalletTrans|wpPayTrans|skrillRedirect|paymentRedirect|userRedirect|lionTrans|nganluongtrans|awePayTrans|kNetTrans|kNet2Trans|globePayTrans|ikajoTrans|accentPayTrans|fatoorahTrans|returnTrans|callbackTrans)>' => array('payment/<action>', 'urlSuffix' => '.html'),
                '/zotopayTrans/<id:\d+>'=>'/payment/zotopayTrans',
                'fund-service' => array('site/fundService', 'urlSuffix' => '.html'),
                'download-platform' => array('site/downloadPlatform', 'urlSuffix' => '.html'),
                'my-assistant-contacts' => array('site/parentContactInfo', 'urlSuffix' => '.html'),
                'changePassword' => array('site/changePassword', 'urlSuffix' => '.html'),
                'ajaxSaveFile' => array('site/ajaxSaveFile', 'urlSuffix' => '.html'),
                'ajaxRemoveFile' => array('site/ajaxRemoveFile', 'urlSuffix' => '.html'),
                'site/<tag:.*?>' => 'site/index',
                //ib
                'ib/<action:(promoCenter|promoBanner|promoVideo|payment|trade|history|segregated|summary|setupConditions|setupLegalInformation|whiteLabel|moneyManager|openLiveAccount|manual|openDemoAccount|clientRegistration|LetterExample|whiteLabelDocs|tradingRules|schedule)>' => array('ib/<action>', 'urlSuffix' => '.html'),
                'ib/profile' => array('ib/setupInformation', 'urlSuffix' => '.html'),
                'ib/setupConditions/<type:.*?>' => array('ib/setupConditions', 'urlSuffix' => '.html'),
                'ib/account-list' => array('ib/AccountList', 'urlSuffix' => '.html'),
                'ib/report_broker_info' => array('ib/ReportBrokerInfo', 'urlSuffix' => '.html'),
                'ib/sign-ib-agreement' => array('ib/signIbAgreement', 'urlSuffix' => '.html'),
                //'ib/traders-agreement-terms' => array('ib/tradersAgreementTerms', 'urlSuffix' => '.html'),
                'ib/closed-sum' => array('ib/ClosedSum', 'urlSuffix' => '.html'),
                'ib/my-website' => array('ib/MySite', 'urlSuffix' => '.html'),
                'ib/closed-trade-sum' => array('ib/ClosedSumTrade', 'urlSuffix' => '.html'),
                'ib/depos-withdrawal' => array('ib/DeposWithdrawal', 'urlSuffix' => '.html'),
                'ib/reports' => array('ib/index', 'urlSuffix' => '.html'),
                'ib/omnibus' => array('ib/omnibus', 'urlSuffix' => '.html'),
                'ib/dwnl_csv' => array('ib/DwnlCsv', 'urlSuffix' => '.html'),
                'ib/account-registration' => array('ib/accountRegistration', 'urlSuffix' => '.html'),
                'ib/whiteLabel_full' => array('ib/whiteLabel_full', 'urlSuffix' => '.html'),
                'ib/<tag:.*?>' => 'ib/index',
                //Admin
                'admin/<action:(inex|setupConditions)>' => array('admin/<action>', 'urlSuffix' => '.html'),
                //company
                'company/<action:(index|risks|reportTransaction|reportTransactionExport|reportTransactionSummary|reportMT|companyInfo|summaryRisksInstr|summaryRisksCurr|summaryPL|setupConditions|accountList)>' => array('company/<action>', 'urlSuffix' => '.html'),
                //sv
                'sv/<action:(competition|employee|competitionRules|competitionResult|competitionResultDaily|competitionResultTotal|trade|summary|findByEmail|leads|crm|addLeads|formsAgreements|clientRegistration|LetterExample|exportLeadsToExcel)>' => array('sv/<action>', 'urlSuffix' => '.html'),
                /* salesCompetition|employeeInformation|legalDocuments|support|conditions|salesRate */
                'sv/account-list' => array('sv/AccountList', 'urlSuffix' => '.html'),
                'sv/reports' => array('sv/index', 'urlSuffix' => '.html'),
                'sv/closed-trade-sum' => array('sv/ClosedSumTrade', 'urlSuffix' => '.html'),
                'sv/closed-sum' => array('sv/ClosedSum', 'urlSuffix' => '.html'),
                'sv/depos-withdrawal' => array('sv/DeposWithdrawal', 'urlSuffix' => '.html'),
                'sv/dwnl_csv' => array('sv/DwnlCsv', 'urlSuffix' => '.html'),
                //sp
                'sp/account-list' => array('sp/AccountList', 'urlSuffix' => '.html'),
                'sp/closed-trade-sum' => array('sp/ClosedSumTrade', 'urlSuffix' => '.html'),
                'sp/closed-sum' => array('sp/ClosedSum', 'urlSuffix' => '.html'),
                'sp/depos-withdrawal' => array('sp/DeposWithdrawal', 'urlSuffix' => '.html'),
                'sp/reports' => array('sp/index', 'urlSuffix' => '.html'),
                'sp/<action:(promoCenter|promoBanner|promoVideo|competition|competitionRules|competitionResult|competitionResultDaily|competitionResultTotal|trade|history|segregated|summary|findByEmail|leads|crm|addLeads|competition|conditions|salesResults|salesRate|formsAgreements|support|clientRegistration|LetterExample|exportLeadsToExcel)>' => array('sp/<action>', 'urlSuffix' => '.html'),
                'sp/my-website' => array('sp/MySite', 'urlSuffix' => '.html'),
                'sp/dwnl_csv' => array('sp/DwnlCsv', 'urlSuffix' => '.html'),
                'sp/<tag:.*?>' => 'sp/index',
                //trader
                'trader/<action:(setupInformation|documents|traderAgreement|platforms|trade|summary|openLiveAccount|openDemoAccount|agreementsWithBMFN|manual)>' => array('trader/<action>', 'urlSuffix' => '.html'),
                'trader/profile' => array('trader/setupInformation', 'urlSuffix' => '.html'),
                'trader/account-list' => array('trader/AccountList', 'urlSuffix' => '.html'),
                'trader/account-registration' => array('trader/accountRegistration', 'urlSuffix' => '.html'),
                'trader/closed-sum' => array('trader/ClosedSum', 'urlSuffix' => '.html'),
                'trader/closed-trade-sum' => array('trader/ClosedSumTrade', 'urlSuffix' => '.html'),
                'trader/depos-withdrawal' => array('trader/DeposWithdrawal', 'urlSuffix' => '.html'),
                'trader/dwnl_csv' => array('trader/DwnlCsv', 'urlSuffix' => '.html'),
                'trader/reports' => array('trader/index', 'urlSuffix' => '.html'),
                //'trader/<action:(education|educBooks|educStrategies|educTutorials|educBeginner|educTools)>' => array('trader/<action>', 'urlSuffix' => '.html'),
                'funds/<action:(transferBankDetails|depositBonus|Inatec|deposit|cryptoDeposit|withdrawal|internalTransfer|credirect|setBonus|withdrawalStatuses|altDeposit|hmDeposit|paymentCards)>' => array('funds/<action>', 'urlSuffix' => '.html'),
                'funds/index' => array('funds/basicInformation', 'urlSuffix' => '.html'),
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
                //trader report demo
                'trader/closed-trade-sum-demo' => array('trader/ClosedSumTrade', 'urlSuffix' => '.html', 'defaultParams' => array('isDemoReport' => true)),
                //mail
                'sendmail' => array('mail/sendmail', 'urlSuffix' => '.php'),
                'testTrans' => array('mail/testTrans', 'urlSuffix' => '.php'),
                //pdf
                'pdf/<action:(tmp|DeclarationOrigin|echoSign|echoSendRequest|ApplicationForm|syncPdfGenerator)>' => array('pdf/<action>', 'urlSuffix' => '.pdf'),
                //education
                'education/index' => array('education/education', 'urlSuffix' => '.html'),
                'education/<action:(books|strategies|tutorials|beginner|tools|beginnerCourse|advancedCourse|metatrader|lesson)>' => array('education/<action>', 'urlSuffix' => '.html'),
                //news
                'news/<action:(list|add|details|addNews|fxNewsList)>' => array('news/<action>', 'urlSuffix' => '.html'),
                '<action:(eCalendar)>' => array('news/<action>', 'urlSuffix' => '.html'),
				'bonus/<action:(activateBonus|accountInfo|myPrizes|takeBonus|generatPrize|changePrizeState|pendingEquityBonusData)>' => array('bonus/<action>', 'urlSuffix' => '.html'),
                // стандартное правило для обработки 'post/update' и др.
                '<action:(viewWeek|viewClient)>' => 'report/<action>',
                'report/<id:\d+>/<title:.*?>' => 'report/view',
                'profile/<tag:.*?>' => 'profile/index',
            ),
        ),
        /*
          Отсылка ошибок почтой

          Если необходимо следить за возникновением ошибок, можно отправлять их себе на почту:

          'log' => array(
          'class' => 'CLogRouter',
          'routes' => array(
          array(
          'class' => 'CEmailLogRoute',
          'categories' => 'error',
          'emails' => array('sam@rmcreative.ru'),
          'sentFrom' => 'error@yiiframework.ru',
          'subject' => 'Error at YiiFramework.ru'
          ),
          ),
          ),
         */
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error',
                ),
            ),
        ),
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => require(dirname(__FILE__) . '/params.php'),
);
