forked from mongodb/laravel-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.php
42 lines (34 loc) · 1.18 KB
/
database.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
$mongoHost = env('MONGO_HOST', 'mongodb');
$mongoPort = env('MONGO_PORT') ? (int) env('MONGO_PORT') : 27017;
$mysqlPort = env('MYSQL_PORT') ? (int) env('MYSQL_PORT') : 3306;
return [
'connections' => [
'mongodb' => [
'name' => 'mongodb',
'driver' => 'mongodb',
'host' => $mongoHost,
'database' => env('MONGO_DATABASE', 'unittest'),
],
'dsn_mongodb' => [
'driver' => 'mongodb',
'dsn' => "mongodb://$mongoHost:$mongoPort",
'database' => env('MONGO_DATABASE', 'unittest'),
],
'dsn_mongodb_db' => [
'driver' => 'mongodb',
'dsn' => "mongodb://$mongoHost:$mongoPort/" . env('MONGO_DATABASE', 'unittest'),
],
'mysql' => [
'driver' => 'mysql',
'host' => env('MYSQL_HOST', 'mysql'),
'port' => $mysqlPort,
'database' => env('MYSQL_DATABASE', 'unittest'),
'username' => env('MYSQL_USERNAME', 'root'),
'password' => env('MYSQL_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
],
],
];