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
41fc898c
Commit
41fc898c
authored
Jan 21, 2016
by
Bob van de Vijver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #2306. Adds support for a connect string when using Oci8
parent
02e5b61b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
configuration.rst
docs/en/reference/configuration.rst
+2
-0
AbstractOracleDriver.php
lib/Doctrine/DBAL/Driver/AbstractOracleDriver.php
+6
-1
AbstractOracleDriverTest.php
...s/Doctrine/Tests/DBAL/Driver/AbstractOracleDriverTest.php
+19
-0
No files found.
docs/en/reference/configuration.rst
View file @
41fc898c
...
...
@@ -296,6 +296,8 @@ pdo\_oci / oci8
add the INSTANCE_NAME parameter in the connection. It is generally used
to connect to an Oracle RAC server to select the name of a particular instance.
Complete connection descriptors are also supported. You only need to provide the following parameter, and none of the above:
- ``connectstring`` (string): Complete Easy Connect connection descriptor, see https://docs.oracle.com/cd/E11882_01/network.112/e41945/naming.htm.
pdo\_sqlsrv / sqlsrv
^^^^^^^^^^^^^^^^^^^^
...
...
lib/Doctrine/DBAL/Driver/AbstractOracleDriver.php
View file @
41fc898c
...
...
@@ -109,10 +109,15 @@ abstract class AbstractOracleDriver implements Driver, ExceptionConverterDriver
*
* @return string
*
* @link http
://download.oracle.com/docs/cd/E11882_01/network.112/e10836
/naming.htm
* @link http
s://docs.oracle.com/cd/E11882_01/network.112/e41945
/naming.htm
*/
protected
function
getEasyConnectString
(
array
$params
)
{
if
(
!
empty
(
$params
[
'connectstring'
]))
{
return
$params
[
'connectstring'
];
}
if
(
!
empty
(
$params
[
'host'
]))
{
if
(
!
isset
(
$params
[
'port'
]))
{
$params
[
'port'
]
=
1521
;
...
...
tests/Doctrine/Tests/DBAL/Driver/AbstractOracleDriverTest.php
View file @
41fc898c
...
...
@@ -25,6 +25,25 @@ class AbstractOracleDriverTest extends AbstractDriverTest
$this
->
assertSame
(
$params
[
'user'
],
$this
->
driver
->
getDatabase
(
$connection
));
}
public
function
testReturnsDatabaseNameWithConnectDescriptor
()
{
$params
=
array
(
'user'
=>
'foo'
,
'password'
=>
'bar'
,
'connectionstring'
=>
'(DESCRIPTION='
.
'(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))'
.
'(CONNECT_DATA=(SERVICE_NAME=baz)))'
);
$connection
=
$this
->
getConnectionMock
();
$connection
->
expects
(
$this
->
once
())
->
method
(
'getParams'
)
->
will
(
$this
->
returnValue
(
$params
));
$this
->
assertSame
(
$params
[
'user'
],
$this
->
driver
->
getDatabase
(
$connection
));
}
protected
function
createDriver
()
{
return
$this
->
getMockForAbstractClass
(
'Doctrine\DBAL\Driver\AbstractOracleDriver'
);
...
...
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