forked from joomlatools/joomlatools-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phinx.php
45 lines (40 loc) · 1.25 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* @package Joomlatools Platform
*
* @copyright Copyright (C) 2016 Johan Janssens and Timble CVBA. (http://www.timble.net)
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
define('_JEXEC', 1);
define('JPATH_ROOT' , __DIR__);
require_once JPATH_ROOT . '/app/defines.php';
require_once JPATH_ROOT . '/app/bootstrap.php';
$config = new JConfig;
$environment = getenv('JOOMLA_ENV');
$host = $config->host;
$port = 3306;
if (strstr($host, ':') !== false) {
list($host, $port) = explode(':', $host);
}
return [
'paths' => [
'migrations' => [
'%%PHINX_CONFIG_DIR%%/install/mysql/migrations/*/',
'%%PHINX_CONFIG_DIR%%/app/administrator/components/com_*/resources/install/mysql/migrations/'
]
],
'environments' => [
'default_migration_table' => 'migrations',
'default_database' => $environment,
$environment => [
'adapter' => 'mysql',
'name' => $config->db,
'host' => $host,
'user' => $config->user,
'pass' => $config->password,
'port' => $port,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci'
]
]
];