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

fix: allow absolute paths for sqlite transport #1015

Merged
merged 2 commits into from
Jan 31, 2020
Merged

fix: allow absolute paths for sqlite transport #1015

merged 2 commits into from
Jan 31, 2020

Conversation

cawolf
Copy link
Contributor

@cawolf cawolf commented Jan 27, 2020

Hi,

when switching from amqp+lib to sqlite3 transport, we were not able to setup DSNs with absolute paths. It seems that parse_url() only allows more than 2 slashes for file: scheme and fails for other schemes (see Notes in the documentation). SQLite however happily uses 3 and more slashes for DSNs.

This PR proposes a special handling for sqlite: scheme and fixes #780. Relevant changes are lines 100-103, the rest is php-cs-fixer.

@makasim
Copy link
Member

makasim commented Jan 27, 2020

There is a better approach to the issue. Could you consider using Dsn class? Check the example https://github.com/php-enqueue/enqueue-dev/blob/master/pkg/fs/FsConnectionFactory.php#L73

That would be great if you could add some tests too.

@cawolf
Copy link
Contributor Author

cawolf commented Jan 29, 2020

Oh great, I didn't check the other transport implementations, but this looks like a cleaner approach. I will update the PR accordingly.

@cawolf
Copy link
Contributor Author

cawolf commented Jan 30, 2020

Do you have more ideas for improving this PR? Or can it be merged?

@makasim makasim merged commit ab74cb9 into php-enqueue:master Jan 31, 2020
@makasim
Copy link
Member

makasim commented Jan 31, 2020

All is good.

@cawolf cawolf deleted the sqlite-allow-absolute-paths branch January 31, 2020 07:53
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

Successfully merging this pull request may close these issues.

Enqueue DBAL DSN invalid
2 participants