Skip to content

Instantly share code, notes, and snippets.

@shengyou
Created October 4, 2016 15:56
Show Gist options
  • Save shengyou/bafbb56b858b79b76386cad00a277a00 to your computer and use it in GitHub Desktop.
Save shengyou/bafbb56b858b79b76386cad00a277a00 to your computer and use it in GitHub Desktop.
setup phinx config using php instead of yaml file.
<?php
require __DIR__.'/bootstrap.php';
return [
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations',
'seeds' => '%%PHINX_CONFIG_DIR%%/db/seeds',
],
'environments' => [
'default_migration_table' => 'phinxlog',
'default_database' => 'development',
'development' => [
'adapter' => 'mysql',
'host' => DB_HOST,
'name' => DB_DATABASE,
'user' => DB_USERNAME,
'pass' => DB_PASSWORD,
'port' => DB_PORT,
'charset' => DB_CHARSET,
],
],
];
@nsbucky
Copy link

nsbucky commented Nov 11, 2017

hey I assume in the bootstrap file you are loading .env file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment