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

DBAL-1234: Additional slash in dbname when providing settings as URL without scheme #1183

Closed
doctrinebot opened this issue May 21, 2015 · 3 comments

Comments

@doctrinebot
Copy link

Jira issue originally created by user KingCrunch:

Hi,

I use https://github.com/realestateconz/MssqlBundle to connect to an MSSQL-database and I'd like to provide the connection parameters as URL. Because dblib is not a supported driver I setup the driverClass instead

driver_class:   \Realestate\MssqlBundle\Driver\PDODblib\Driver

So the corresponding URL would look like

//user:pass@127.0.0.1/dabasename

But now it tries to connect to the database /databasename instead of databasename. I can set an arbitrary scheme here as long as it exists and is supported (and is not SQLite)

mysqli://user:pass@127.0.0.1/dabasename

Now it works, but it's a hack.

It seems, that the issue is here

if (!isset($url['scheme']) || (strpos($url['scheme'], 'sqlite') !== false && $url['path'] == ':memory:')) {

As long as there is no scheme the leading slash remains. I'd guess, that it should also take into account, that there might be no driver name, but a concrete driverClass instead

(!isset($url['scheme']) && !isset(isset($url['driverClass']))

?

@doctrinebot
Copy link
Author

@doctrinebot doctrinebot added the Bug label Dec 6, 2015
@deeky666 deeky666 added this to the 2.5.5 milestone Jan 9, 2016
@deeky666 deeky666 assigned deeky666 and unassigned beberlei Jan 9, 2016
@deeky666 deeky666 added the WIP label Jan 9, 2016
deeky666 added a commit to deeky666/dbal that referenced this issue Jan 9, 2016
…river connection parameters

- includes extended default driver connection parameter handling
- minor refactoring

fixes doctrine#1183
Ocramius pushed a commit that referenced this issue Sep 9, 2016
…river connection parameters

- includes extended default driver connection parameter handling
- minor refactoring

fixes #1183
@Ocramius
Copy link
Member

Ocramius commented Sep 9, 2016

Handled in #2287

@github-actions
Copy link

github-actions bot commented Aug 7, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants