-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FEATURE] Allow other adapters for Phinx configuration #29
base: master
Are you sure you want to change the base?
Conversation
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.
Sorry for the late response, please have a look at my remarks.
{ | ||
return $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']; | ||
switch ($connection->getDatabasePlatform()->getName()) { |
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.
Seems like we could put this directly in $adapter
instead.
Also what's the reason from using a connection instead of the raw TYPO3 config?
$pathInfo = pathinfo($connection->getDatabase()); | ||
$name = $pathInfo['dirname'] . '/' . $pathInfo['filename']; | ||
$suffix = '.' . $pathInfo['extension']; |
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.
There seems to be a lot of magic / hidden knowledge going on here. Is there no Doctrine DBAL API for this?
|
||
return [ | ||
'adapter' => $adapter, | ||
'host' => $connection->getParams()['host'] ?? null, |
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'd at least call getParams()
only once. Also it seems like we can basically return that $params
then.
Finally getParams()
is marked as @internal
so we should not rely on it.
See: https://book.cakephp.org/phinx/0/en/configuration.html#supported-adapters
My instance crashes as i use sqlite. This PR checks per connection configured configuration and returns the environment array for phinx.