<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/20
 * Time: 9:09
 */

$tmp_config = [
    'common' => [
        'pgsql' => [
            'driver' => 'pgsql',
            'host' => '192.168.2.200',
            'port' => 10432,
            'database' => 'kaiyou',
            'username' => 'kaiyou',
            'password' => '123456',
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => ''
        ],

        //redis配置
        'redis' => [
            'host' => '192.168.2.200',
            'port' => 26379,
            'passwd' => '',
            'db' => 0,
            'overtime' => 1,
        ],
        //主进程
        'swoole' => [
            'host' => '0.0.0.0',
            'port' => '9090',
            'maxUsers' => 50000,
            'sets' => [
                'worker_num' => 2,
                'daemonize' => false,
                'max_request' => 50,
                'task_enable_coroutine' => true,
                'dispatch_mode' => 2,
                'debug_mode' => 1,
                'task_worker_num' => 2,
                'log_file' => '../logs/swoole_'.date("Ymd").'.log',
            ],
        ],

        //子进程业务
        'swoole_subserv' => [
            'host' => '0.0.0.0',
            'port' => '9092',
            'sets'=>[
                'worker_num' => 3,
                'daemonize' => true,
                'max_request' => 5000,
                'task_enable_coroutine' => true,
                'dispatch_mode' => 2,
                'debug_mode' => 1,
                'log_file' => '../logs/swoole_subserv_'.date("Ymd").'.log',
            ],
        ],

        //数据库代理配置--pgsql
        'pgsqlpoole' => [
            'poole_host' => '0.0.0.0',
            'poole_port' => 9091,

            'db_type' => 'pgsql',
            'db_host' => '192.168.2.200',
            'db_port' => 10432,
            'db_name' => 'pai',
            'db_user' => 'kaiyou',
            'db_pwd' => '123456',
        ],

        //管理员使用的
        'admin_conf' => [
            'url' => 'ws://192.168.2.200:9090',
            'admin_uid' => 999999999,
            'whiteips' =>['172.17.0.*','127.0.0.1'],
            'md5' => '70d8d42d4307e63702b25ddef0129f72',
            'admin_token' => 'aaminaeyJhb34G6i6JIU6I1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJib3JuIiwiaWF0IjoxNTU4NTk1MjgxLCJleHAiOjE1NTg2MDI0ODEsIm5iZiI6MTU1ODU5NTM0MSwic3ViIjo3NiwianRpIjoiNWIwYjlkNjMtYmQ5My1kNTBkLTA1NzgtZGU0NDEyYjFmZjBlIn0.jaYz1IcJJxNCaEF-ELCcE6JjbFSjKPl0p-whJ76dV1w',
        ],
    ],
    'dev' => [
        'mysql' => [
            'driver' => 'mysql',
            'host' => '192.168.2.200',
            'port' => 3306,
            'database' => 'ds_cms',
            'username' => 'vali',
            'user' => 'vali',
            'password' => '1234',
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci'
        ],
    ],
    'test' => [

    ],
    'prod' => [
    ],
];

return array_merge($tmp_config['common'], $tmp_config[ENV]);
