-
Notifications
You must be signed in to change notification settings - Fork 466
Expand file tree
/
Copy pathtravis-ci-settings.php
More file actions
62 lines (54 loc) · 2.04 KB
/
travis-ci-settings.php
File metadata and controls
62 lines (54 loc) · 2.04 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env php
<?php
declare(strict_types=1);
/*
* +----------------------------------------------------------------------+
* | ThinkSNS Plus |
* +----------------------------------------------------------------------+
* | Copyright (c) 2016-Present ZhiYiChuangXiang Technology Co., Ltd. |
* +----------------------------------------------------------------------+
* | This source file is subject to enterprise private license, that is |
* | bundled with this package in the file LICENSE, and is available |
* | through the world-wide-web at the following url: |
* | https://github.com/slimkit/plus/blob/master/LICENSE |
* +----------------------------------------------------------------------+
* | Author: Slim Kit Group <master@zhiyicx.com> |
* | Homepage: www.thinksns.com |
* +----------------------------------------------------------------------+
*/
$db = $argv[1] ?? 'mysql';
$connection = [];
switch ($db) {
case 'postgres':
case 'pgsql':
$connection = [
'DB_CONNECTION' => 'pgsql',
'DB_HOST' => '127.0.0.1',
'DB_PORT' => '5432',
'DB_DATABASE' => 'plus',
'DB_USERNAME' => 'postgres',
'DB_PASSWORD' => 'postgres',
];
break;
case 'mysql':
default:
$connection = [
'DB_CONNECTION' => 'mysql',
'DB_HOST' => '127.0.0.1',
'DB_PORT' => '3306',
'DB_DATABASE' => 'plus',
'DB_USERNAME' => 'root',
'DB_PASSWORD' => '',
];
break;
}
$connection = array_merge($connection, [
'APP_ENV' => 'testing',
'APP_DEBUG'=> 'true',
]);
$basePath = dirname(__DIR__);
$env = file_get_contents($basePath.'/storage/configure/.env.example');
foreach ($connection as $key => $value) {
$env .= PHP_EOL.$key.'='.$value.PHP_EOL;
}
file_put_contents($basePath.'/storage/configure/.env', $env);