<?php
/**
 * Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *
 */

if(getenv('DEVELOPMENT')) {
    $db_conf =  [
        'driver' => 'Pdo_mysql',
        'host' => 'db',
        'dbname' => 'addcpm',
        'user' => 'addcpm',
        'password' => 'addcpm',
        'charset' => 'UTF8',
        'driver_options' => [
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ],
    ];
    $db_ecpa_conf =  [
        'driver' => 'Pdo_mysql',
        'host' => 'db',
        'dbname' => 'ecpa',
        'user' => 'addcpm',
        'password' => 'addcpm',
        'charset' => 'UTF8',
        'driver_options' => [
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ],
    ];
    $db_retarg_conf =  [
        'driver' => 'Pdo_mysql',
        'host' => 'db',
        'dbname' => 'retarg',
        'user' => 'addcpm',
        'password' => 'addcpm',
        'charset' => 'UTF8',
        'driver_options' => [
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ],
    ];
    $db_tpl_conf =  [
        'driver' => 'Pdo_mysql',
        'host' => 'db',
        'dbname' => 'tpl',
        'user' => 'addcpm',
        'password' => 'addcpm',
        'charset' => 'UTF8',
        'driver_options' => [
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ],
    ];
    
} else {
    $db_conf = [
        'driver' => 'Pdo_mysql',
        'host' => '127.0.0.1',
        'dbname' => 'addcpm',
        'user' => 'addcpm',
        'password' => 'YiLMLZ3rTdYx10M5OMg7b0uoQAa2QxkR',
        'charset' => 'UTF8',
        'driver_options' => [
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ],
    ];
    $db_ecpa_conf = [
        'driver' => 'Pdo_mysql',
        'host' => '185.187.80.139',
        'dbname' => 'ecpa',
        'user' => 'addcpm',
        'password' => 'Xvq7jtFetUKgHe7vHQTwPA1Jf1LabkV9',
        'charset' => 'UTF8',
        'driver_options' => [
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ],
    ];
    $db_retarg_conf = [
        'driver' => 'Pdo_mysql',
        'host' => '185.187.80.139',
        'dbname' => 'retarg',
        'user' => 'addcpm',
        'password' => 'Xvq7jtFetUKgHe7vHQTwPA1Jf1LabkV9',
        'charset' => 'UTF8',
        'driver_options' => [
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ],
    ];
    $db_tpl_conf = [
        'driver' => 'Pdo_mysql',
        'host' => '185.187.80.139',
        'dbname' => 'tpl',
        'user' => 'addcpm',
        'password' => 'Xvq7jtFetUKgHe7vHQTwPA1Jf1LabkV9',
        'charset' => 'UTF8',
        'driver_options' => [
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ],
    ];

}

return [
    'db' => $db_conf,
    'db_ecpa' => $db_ecpa_conf,
    'db_retarg' => $db_retarg_conf,
    'db_tpl' => $db_tpl_conf,
    'dependencies' => [
        'factories' => [
        ]
    ]
];