adding phinx.php
This commit is contained in:
parent
4be824a962
commit
3db175d542
1 changed files with 31 additions and 0 deletions
31
phinx.php
Normal file
31
phinx.php
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once 'vendor/autoload.php';
|
||||||
|
|
||||||
|
use Phalcon\Config\Adapter\Yaml as Config;
|
||||||
|
|
||||||
|
$config = new Config('app/config/conf.local.yml');
|
||||||
|
|
||||||
|
$phinx = [
|
||||||
|
'paths' => [
|
||||||
|
'migrations' => 'app/migrations'
|
||||||
|
],
|
||||||
|
'environments' => [
|
||||||
|
'default_database' => 'main',
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$db = $config->get('database');
|
||||||
|
if ($db) {
|
||||||
|
$phinx['environments']['main'] = [
|
||||||
|
'adapter' => strtolower($db->adapter),
|
||||||
|
'host' => $db->host,
|
||||||
|
'user' => $db->username,
|
||||||
|
'pass' => $db->password,
|
||||||
|
'name' => $db->dbname,
|
||||||
|
'charset' => $db->charset,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $phinx;
|
||||||
Reference in a new issue