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
75fed365
Commit
75fed365
authored
Sep 24, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added static method driverName
parent
a184f4ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
DB.php
draft/DB.php
+16
-6
No files found.
draft/DB.php
View file @
75fed365
...
...
@@ -196,9 +196,19 @@ class Doctrine_DB2 implements Countable, IteratorAggregate {
}
return
self
::
$instances
[
$md5
];
}
public
static
function
driverName
()
{
/**
* driverName
* converts a driver name like (oracle) to appropriate PDO
* driver name (oci8 in the case of oracle)
*
* @param string $name
* @return string
*/
public
static
function
driverName
(
$name
)
{
if
(
isset
(
self
::
$driverMap
[
$name
]))
return
self
::
$driverMap
[
$name
];
return
$name
;
}
/**
* parseDSN
...
...
@@ -207,6 +217,7 @@ class Doctrine_DB2 implements Countable, IteratorAggregate {
* @return array Parsed contents of DSN
*/
function
parseDSN
(
$dsn
)
{
// silence any warnings
$parts
=
@
parse_url
(
$dsn
);
$names
=
array
(
'scheme'
,
'host'
,
'port'
,
'user'
,
'pass'
,
'path'
,
'query'
,
'fragment'
);
...
...
@@ -220,9 +231,8 @@ class Doctrine_DB2 implements Countable, IteratorAggregate {
throw
new
Doctrine_DB_Exception
(
'Empty data source name'
);
$drivers
=
self
::
getAvailableDrivers
();
if
(
isset
(
self
::
$driverMap
[
$parts
[
'scheme'
]]))
$parts
[
'scheme'
]
=
self
::
$driverMap
[
$parts
[
'scheme'
]];
$parts
[
'scheme'
]
=
self
::
driverName
(
$parts
[
'scheme'
]);
if
(
!
in_array
(
$parts
[
'scheme'
],
$drivers
))
throw
new
Doctrine_DB_Exception
(
'Driver '
.
$parts
[
'scheme'
]
.
' not availible or extension not loaded'
);
...
...
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