Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
bddcb16e
Commit
bddcb16e
authored
Nov 26, 2014
by
David Zuelke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support dashes in schemes for db drivers, translated to underscores
parent
fbc96155
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
DriverManager.php
lib/Doctrine/DBAL/DriverManager.php
+1
-0
DriverManagerTest.php
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
+4
-0
No files found.
lib/Doctrine/DBAL/DriverManager.php
View file @
bddcb16e
...
@@ -238,6 +238,7 @@ final class DriverManager
...
@@ -238,6 +238,7 @@ final class DriverManager
}
}
if
(
isset
(
$url
[
'scheme'
]))
{
if
(
isset
(
$url
[
'scheme'
]))
{
$url
[
'scheme'
]
=
str_replace
(
'-'
,
'_'
,
$url
[
'scheme'
]);
// URL schemes must not contain underscores, but dashes are ok
if
(
isset
(
self
::
$_driverSchemeAliases
[
$url
[
'scheme'
]]))
{
if
(
isset
(
self
::
$_driverSchemeAliases
[
$url
[
'scheme'
]]))
{
$params
[
'driver'
]
=
self
::
$_driverSchemeAliases
[
$url
[
'scheme'
]];
// use alias
$params
[
'driver'
]
=
self
::
$_driverSchemeAliases
[
$url
[
'scheme'
]];
// use alias
}
else
{
}
else
{
...
...
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
View file @
bddcb16e
...
@@ -199,6 +199,10 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
...
@@ -199,6 +199,10 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
'drizzle_pdo_mysql://foo:bar@localhost/baz'
,
'drizzle_pdo_mysql://foo:bar@localhost/baz'
,
false
,
false
,
),
),
'simple URL with fallthrough scheme containing dashes works'
=>
array
(
'drizzle-pdo-mysql://foo:bar@localhost/baz'
,
array
(
'user'
=>
'foo'
,
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'driver'
=>
'Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver'
),
),
);
);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment