-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix baking snapshots #89
Conversation
|
||
if (!empty($this->params['plugin'])) { | ||
$_SERVER['argv'][] = '-p'; | ||
$_SERVER['argv'][] = $this->params['plugin']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really wish phinx had a less gross way of integrating sub commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah me too.
I looked it up a bit and it is currently the only way I found.
I'll give it another shot just in case.
Edit : on second thoughts, we are in a "bake context". phinx might not be the problem here. Anyway, I'll investigate this.
… should be propagated to the mark_migrated dispatched Shell
…tched after a snapshot was baked
16d5b74
to
e09a12e
Compare
@markstory I found a way to prevent the dirty stuff when dispatching the Shell. I think that in a more general way, dispatching a migrations shell currently does not work. |
$app->run(); | ||
|
||
$input = new ArgvInput($this->argv); | ||
$app->run($input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to modify $_SERVER['argv']
now that you're passing ArgvInput
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, probably not.
I'll remove it and see.
Looks great 👍 |
@markstory You were right :) |
After a snapshot was baked, the
connection
and theplugin
options should be propagated to themark_migrated
dispatched Shell.Not doing so resulted in the
mark_migrated
call to be executed with the default connection which was unexpected and caused problems.I know the tests and the mark_migrated shell dispatching seems weird but I actually can put anything in place of the
$dispatchCommand
and it would work. What matters is the content of the$_SERVER['argv']
variable (if anyone knows why and would care to explain, I'll be glad).But I still need to build a correct string for the tests.
Should fix #88