Repository navigation
Expand file tree
/
Copy pathphinx.php
More file actions
58 lines (51 loc) · 1.53 KB
/
Copy pathphinx.php
File metadata and controls
58 lines (51 loc) · 1.53 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
<?php
declare(strict_types=1);
use Dotenv\Dotenv;
require __DIR__ . '/vendor/autoload.php';
if (file_exists(__DIR__ . '/.env')) {
Dotenv::createImmutable(__DIR__)->load();
}
$env = $_ENV['APP_ENV'] ?? 'dev';
$connections = [
'dev' => [
'adapter' => 'pgsql',
'host' => $_ENV['DB_HOST'] ?? 'db',
'port' => $_ENV['DB_PORT'] ?? '5432',
'name' => $_ENV['DB_NAME'] ?? 'slimtds',
'user' => $_ENV['DB_USER'] ?? 'slimtds',
'pass' => $_ENV['DB_PASSWORD'] ?? 'slimtds',
'charset' => 'utf8',
],
'test' => [
'adapter' => 'pgsql',
'host' => 'db-test',
'port' => '5432',
'name' => 'slimtds_test',
'user' => 'slimtds',
'pass' => 'slimtds',
'charset' => 'utf8',
],
'prod' => [
'adapter' => 'pgsql',
'host' => $_ENV['DB_HOST'] ?? 'db',
'port' => $_ENV['DB_PORT'] ?? '5432',
'name' => $_ENV['DB_NAME'] ?? 'slimtds',
'user' => $_ENV['DB_USER'] ?? 'slimtds',
'pass' => $_ENV['DB_PASSWORD'] ?? 'slimtds',
'charset' => 'utf8',
],
];
return [
'paths' => [
'migrations' => __DIR__ . '/migrations',
'seeds' => __DIR__ . '/seeds',
],
'environments' => [
'default_migration_table' => 'phinxlog',
'default_environment' => $env,
'dev' => $connections['dev'],
'test' => $connections['test'],
'prod' => $connections['prod'],
],
'version_order' => 'creation',
];