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
f771cecc
Commit
f771cecc
authored
Dec 19, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix whitespaces
parent
5964c0b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
DriverManager.php
lib/Doctrine/DBAL/DriverManager.php
+19
-19
No files found.
lib/Doctrine/DBAL/DriverManager.php
View file @
f771cecc
...
@@ -55,37 +55,37 @@ final class DriverManager
...
@@ -55,37 +55,37 @@ final class DriverManager
* driver connection.
* driver connection.
*
*
* $params must contain at least one of the following.
* $params must contain at least one of the following.
*
*
* Either 'driver' with one of the following values:
* Either 'driver' with one of the following values:
* pdo_mysql
* pdo_mysql
* pdo_sqlite
* pdo_sqlite
* pdo_pgsql
* pdo_pgsql
* pdo_oracle
* pdo_oracle
* pdo_sqlsrv
* pdo_sqlsrv
*
*
* OR 'driverClass' that contains the full class name (with namespace) of the
* OR 'driverClass' that contains the full class name (with namespace) of the
* driver class to instantiate.
* driver class to instantiate.
*
*
* Other (optional) parameters:
* Other (optional) parameters:
*
*
* <b>user (string)</b>:
* <b>user (string)</b>:
* The username to use when connecting.
* The username to use when connecting.
*
*
* <b>password (string)</b>:
* <b>password (string)</b>:
* The password to use when connecting.
* The password to use when connecting.
*
*
* <b>driverOptions (array)</b>:
* <b>driverOptions (array)</b>:
* Any additional driver-specific options for the driver. These are just passed
* Any additional driver-specific options for the driver. These are just passed
* through to the driver.
* through to the driver.
*
*
* <b>pdo</b>:
* <b>pdo</b>:
* You can pass an existing PDO instance through this parameter. The PDO
* You can pass an existing PDO instance through this parameter. The PDO
* instance will be wrapped in a Doctrine\DBAL\Connection.
* instance will be wrapped in a Doctrine\DBAL\Connection.
*
*
* <b>wrapperClass</b>:
* <b>wrapperClass</b>:
* You may specify a custom wrapper class through the 'wrapperClass'
* You may specify a custom wrapper class through the 'wrapperClass'
* parameter but this class MUST inherit from Doctrine\DBAL\Connection.
* parameter but this class MUST inherit from Doctrine\DBAL\Connection.
*
*
* @param array $params The parameters.
* @param array $params The parameters.
* @param Doctrine\DBAL\Configuration The configuration to use.
* @param Doctrine\DBAL\Configuration The configuration to use.
* @param Doctrine\Common\EventManager The event manager to use.
* @param Doctrine\Common\EventManager The event manager to use.
...
@@ -103,7 +103,7 @@ final class DriverManager
...
@@ -103,7 +103,7 @@ final class DriverManager
if
(
!
$eventManager
)
{
if
(
!
$eventManager
)
{
$eventManager
=
new
EventManager
();
$eventManager
=
new
EventManager
();
}
}
// check for existing pdo object
// check for existing pdo object
if
(
isset
(
$params
[
'pdo'
])
&&
!
$params
[
'pdo'
]
instanceof
\PDO
)
{
if
(
isset
(
$params
[
'pdo'
])
&&
!
$params
[
'pdo'
]
instanceof
\PDO
)
{
throw
DBALException
::
invalidPdoInstance
();
throw
DBALException
::
invalidPdoInstance
();
...
@@ -118,9 +118,9 @@ final class DriverManager
...
@@ -118,9 +118,9 @@ final class DriverManager
}
else
{
}
else
{
$className
=
self
::
$_driverMap
[
$params
[
'driver'
]];
$className
=
self
::
$_driverMap
[
$params
[
'driver'
]];
}
}
$driver
=
new
$className
();
$driver
=
new
$className
();
$wrapperClass
=
'Doctrine\DBAL\Connection'
;
$wrapperClass
=
'Doctrine\DBAL\Connection'
;
if
(
isset
(
$params
[
'wrapperClass'
]))
{
if
(
isset
(
$params
[
'wrapperClass'
]))
{
if
(
is_subclass_of
(
$params
[
'wrapperClass'
],
$wrapperClass
))
{
if
(
is_subclass_of
(
$params
[
'wrapperClass'
],
$wrapperClass
))
{
...
@@ -129,7 +129,7 @@ final class DriverManager
...
@@ -129,7 +129,7 @@ final class DriverManager
throw
DBALException
::
invalidWrapperClass
(
$params
[
'wrapperClass'
]);
throw
DBALException
::
invalidWrapperClass
(
$params
[
'wrapperClass'
]);
}
}
}
}
return
new
$wrapperClass
(
$params
,
$driver
,
$config
,
$eventManager
);
return
new
$wrapperClass
(
$params
,
$driver
,
$config
,
$eventManager
);
}
}
...
@@ -139,16 +139,16 @@ final class DriverManager
...
@@ -139,16 +139,16 @@ final class DriverManager
* @param array $params
* @param array $params
*/
*/
private
static
function
_checkParams
(
array
$params
)
private
static
function
_checkParams
(
array
$params
)
{
{
// check existance of mandatory parameters
// check existance of mandatory parameters
// driver
// driver
if
(
!
isset
(
$params
[
'driver'
])
&&
!
isset
(
$params
[
'driverClass'
]))
{
if
(
!
isset
(
$params
[
'driver'
])
&&
!
isset
(
$params
[
'driverClass'
]))
{
throw
DBALException
::
driverRequired
();
throw
DBALException
::
driverRequired
();
}
}
// check validity of parameters
// check validity of parameters
// driver
// driver
if
(
isset
(
$params
[
'driver'
])
&&
!
isset
(
self
::
$_driverMap
[
$params
[
'driver'
]]))
{
if
(
isset
(
$params
[
'driver'
])
&&
!
isset
(
self
::
$_driverMap
[
$params
[
'driver'
]]))
{
throw
DBALException
::
unknownDriver
(
$params
[
'driver'
],
array_keys
(
self
::
$_driverMap
));
throw
DBALException
::
unknownDriver
(
$params
[
'driver'
],
array_keys
(
self
::
$_driverMap
));
...
@@ -158,4 +158,4 @@ final class DriverManager
...
@@ -158,4 +158,4 @@ final class DriverManager
throw
DBALException
::
invalidDriverClass
(
$params
[
'driverClass'
]);
throw
DBALException
::
invalidDriverClass
(
$params
[
'driverClass'
]);
}
}
}
}
}
}
\ 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