Skip to content
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

Text Wrapper crashes without configuration #959

Closed
moritz-h opened this issue Sep 21, 2016 · 3 comments
Closed

Text Wrapper crashes without configuration #959

moritz-h opened this issue Sep 21, 2016 · 3 comments

Comments

@moritz-h
Copy link
Contributor

moritz-h commented Sep 21, 2016

Running the text wrapper does not work like it is described in the Documentation: LINK

When i just run php -S localhost:8000 vendor/robmorgan/phinx/app/web.php i get a PHP Fatal error: Uncaught Symfony\Component\Console\Exception\InvalidOptionException: The "--configuration" option requires a value.
(I run this from my project root, there is also a phinx.php located)

It works when i additionally set some Options like this. (It also seems, that default_database from the config file is ignored, and i need to set the 'environment' option.)

$app = new \Phinx\Console\PhinxApplication();
$wrap = new \Phinx\Wrapper\TextWrapper($app);
$wrap->setOption('configuration', 'phinx.php');
$wrap->setOption('parser', 'php');
$wrap->setOption('environment', 'db');

echo $wrap->getStatus();
echo $wrap->getRollback(null, 0);
echo $wrap->getMigrate();
echo $wrap->getSeed();

So ether this is a bug, that the text wrapper crashes without setting configuration, or if the text wrapper needs the configuration this should be mentioned in the documentation.

Edit: Version is 0.6.4

@piotr-cz
Copy link
Contributor

piotr-cz commented May 9, 2017

Same in 0.8.0. The #1055 fixes the issue however I'm getting another fatal The file "phinx.yml" does not exist (I'm using phinx.php)


Update: I had to change CWD to root

@rquadling
Copy link
Collaborator

@piotr-cz If you set the path in $wrap->setOption('configuration', '/path/to/phinx.php'); does this work appropriately?

@piotr-cz
Copy link
Contributor

piotr-cz commented May 11, 2017

Yes, it does, like that::

$app = new \Phinx\Console\PhinxApplication();
$wrap = new \Phinx\Wrapper\TextWrapper($app, [
    'configuration' => $appSettings['root'] . '/phinx.php'
]);

By the way I think it's time for v0.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants