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
f0f6ca25
Commit
f0f6ca25
authored
Nov 14, 2013
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrap driver connection exceptions
parent
653c4df3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
Driver.php
lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
+18
-13
No files found.
lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
View file @
f0f6ca25
...
...
@@ -36,7 +36,8 @@ class Driver implements \Doctrine\DBAL\Driver
/**
* {@inheritdoc}
*
* @throws SQLAnywhereException
* @throws \Doctrine\DBAL\DBALException if there was a problem establishing the connection.
* @throws SQLAnywhereException if a mandatory connection parameter is missing.
*/
public
function
connect
(
array
$params
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
array
())
{
...
...
@@ -52,18 +53,22 @@ class Driver implements \Doctrine\DBAL\Driver
throw
new
SQLAnywhereException
(
"Missing 'dbname' in configuration for sqlanywhere driver."
);
}
return
new
SQLAnywhereConnection
(
$this
->
buildDsn
(
$params
[
'host'
],
isset
(
$params
[
'port'
])
?
$params
[
'port'
]
:
null
,
$params
[
'server'
],
$params
[
'dbname'
],
$username
,
$password
,
$driverOptions
),
isset
(
$params
[
'persistent'
])
?
$params
[
'persistent'
]
:
false
);
try
{
return
new
SQLAnywhereConnection
(
$this
->
buildDsn
(
$params
[
'host'
],
isset
(
$params
[
'port'
])
?
$params
[
'port'
]
:
null
,
$params
[
'server'
],
$params
[
'dbname'
],
$username
,
$password
,
$driverOptions
),
isset
(
$params
[
'persistent'
])
?
$params
[
'persistent'
]
:
false
);
}
catch
(
SQLAnywhereException
$e
)
{
throw
DBALException
::
driverException
(
$this
,
$e
);
}
}
/**
...
...
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