-
Notifications
You must be signed in to change notification settings - Fork 15
/
phinx.php
29 lines (26 loc) · 883 Bytes
/
phinx.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
<?php
$db_config = require __DIR__ . '/dbconfig.php';
$dsn_entries = [];
foreach (explode(';', parse_url($db_config['dsn'], PHP_URL_PATH)) as $entry) {
[$key, $val] = explode('=', $entry, 2);
$dsn_entries[urldecode($key)] = urldecode($val);
}
return [
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations',
'seeds' => '%%PHINX_CONFIG_DIR%%/db/seeds'
],
'environments' => [
'default_migration_table' => 'phinxlog',
'default_environment' => 'production',
'production' => [
'adapter' => parse_url($db_config['dsn'], PHP_URL_SCHEME),
'name' => $dsn_entries['dbname'],
'host' => $dsn_entries['host'],
'user' => $db_config['user'],
'pass' => $db_config['password'],
'charset' => 'utf8',
],
],
'version_order' => 'creation'
];