<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

 return [
    // 默认数据库
    'default' => env_get('database.driver','mysql'),
    // 各种数据库配置
    'connections' => [
   
        'mysql' => [
            'driver'      => 'mysql',
            'host'        => env_get('database.mysql.host','127.0.0.1'),
            'port'        => env_get('database.mysql.port',3306),
            'database'    => env_get('database.mysql.database','webman'),
            'username'    => env_get('database.mysql.username','webman'),
            'password'    => env_get('database.mysql.password',''),
            'unix_socket' => '',
            'charset'     => env_get('database.mysql.charset','utf8'),
            'collation'   => env_get('database.mysql.collation','utf8_unicode_ci'),
            'prefix'      => env_get('database.mysql.prefix',''),
            'strict'      => true,
            'engine'      => null,
        ],
   
        'sqlite' => [
            'driver'   => 'sqlite',
            'database' => base_path().env_get('database.sqlite.database','/db.db'),
            'prefix'   => env_get('database.sqlite.prefix',''),
        ],
   
        'postgre' => [
            'driver'   => 'pgsql',
            'host'     => env_get('database.postgre.host','127.0.0.1'),
            'port'     => env_get('database.postgre.port',5432),
            'database' => env_get('database.postgre.database','webman'),
            'username' => env_get('database.postgre.username','webman'),
            'password' => env_get('database.postgre.password',''),
            'charset'  => env_get('database.postgre.charset','utf8'),
            'prefix'   => env_get('database.postgre.prefix',''),
            'schema'   => env_get('database.postgre.schema','public'),
            'sslmode'  => env_get('database.postgre.sslmode','prefer'),
        ],
   
        'sqlserver' => [
            'driver'   => 'sqlsrv',
            'host'     => env_get('database.sqlserver.host','127.0.0.1'),
            'port'     => env_get('database.sqlserver.port',1433),
            'database' => env_get('database.sqlserver.database','webman'),
            'username' => env_get('database.sqlserver.username','webman'),
            'password' => env_get('database.sqlserver.password',''),
            'charset'  => env_get('database.sqlserver.charset','utf8'),
            'prefix'   => env_get('database.sqlserver.prefix',''),
        ],
    ],
   ];
