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

Undefined index when using 'connection' option #1170

Closed
thewunder opened this issue Sep 5, 2017 · 8 comments
Closed

Undefined index when using 'connection' option #1170

thewunder opened this issue Sep 5, 2017 · 8 comments

Comments

@thewunder
Copy link

thewunder commented Sep 5, 2017

This is a regression after updating to 0.9.0, looks like the connection option (the pdo instance) is not getting set on the adapter.

Error: Undefined index: host on line 89 of /vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php in /src/Lifestyle/ErrorHandler.php:53
Stack trace:#0 /vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php(89): Lifestyle\\ErrorHandler->errorHandler(8, 'Undefined index...', '/var/www/dev_20...', 89, Array)
#1 /vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(88): Phinx\\Db\\Adapter\\MysqlAdapter->connect()
#2 /vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(128): Phinx\\Db\\Adapter\\PdoAdapter->getConnection()
#3 /vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(146): Phinx\\Db\\Adapter\\PdoAdapter->query('SELECT * FROM p...')
#4 /vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(231): Phinx\\Db\\Adapter\\PdoAdapter->fetchAll('SELECT * FROM p...')
#5 /vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(208): Phinx\\Db\\Adapter\\PdoAdapter->getVersionLog()
#6 /vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(215): Phinx\\Db\\Adapter\\PdoAdapter->getVersions()
#7 /vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(258): Phinx\\Db\\Adapter\\AdapterWrapper->getVersions()
#8 /vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(300): Phinx\\Migration\\Manager\\Environment->getVersions()
#9 /vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(114): Phinx\\Migration\\Manager->migrate('dev', NULL)
#10 /vendor/symfony/console/Command/Command.php(264): Phinx\\Console\\Command\\Migrate->execute(Object(Symfony\\Component\\Console\\Input\\ArrayInput), Object(Symfony\\Component\\Console\\Output\\StreamOutput))
#11 /vendor/symfony/console/Application.php(888): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArrayInput), Object(Symfony\\Component\\Console\\Output\\StreamOutput))
@thewunder
Copy link
Author

Snippet from my phinx.php file

return [
    'paths'                     => [
        'migrations'    => $app['base_dir'] . 'db' . DIRECTORY_SEPARATOR . 'migrations',
        'seeds'         => $app['base_dir'] . 'db' . DIRECTORY_SEPARATOR . 'seeds'
    ],
    'default_database'          => $app['environment_name'],
    'environments'              => [
        $app['environment_name']    => [
            'name'          => $app['db_name'],
            'connection'    => $app['pdo']
        ]
    ]
];

@swiffer
Copy link
Contributor

swiffer commented Sep 7, 2017

Yes, Same here. Update broke phinx due to this.

@lorenzo
Copy link
Member

lorenzo commented Sep 7, 2017

@thewunder @swiffer would any of you like to send a pull request with the fix?

@swiffer
Copy link
Contributor

swiffer commented Sep 7, 2017

pull request is open 😄

#1171

@swiffer
Copy link
Contributor

swiffer commented Sep 7, 2017

think the code deleted here was not save to remove completly

v0.8.1...master#diff-1ba3851ff60f2161d4cf1849606cd4a3L104

@lorenzo lorenzo closed this as completed in 2cdf9da Sep 7, 2017
@thewunder
Copy link
Author

@lorenzo I would consider a release just for this fix. I'm sure this makes 0.9.0 unusable for a decent portion of users.

@swiffer
Copy link
Contributor

swiffer commented Sep 7, 2017

Yes, having a fix Release would bei great!

@lorenzo
Copy link
Member

lorenzo commented Sep 8, 2017

Yeah, I was planning on doing that, but did not get enough time yesterday to finish it.

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