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
e0e5bf49
Commit
e0e5bf49
authored
Dec 29, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #471 from deeky666/DBAL-685
[DBAL-685] Add servicename connection parameter to Oracle drivers
parents
9bc6cd02
45113e7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
configuration.rst
docs/en/reference/configuration.rst
+8
-0
Driver.php
lib/Doctrine/DBAL/Driver/OCI8/Driver.php
+9
-3
Driver.php
lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php
+10
-4
No files found.
docs/en/reference/configuration.rst
View file @
e0e5bf49
...
...
@@ -179,6 +179,14 @@ pdo\_oci / oci8
- ``host`` (string): Hostname of the database to connect to.
- ``port`` (integer): Port of the database to connect to.
- ``dbname`` (string): Name of the database/schema to connect to.
- ``servicename`` (string): Optional name by which clients can
connect to the database instance. Will be used as Oracle's
``SID`` connection parameter if given and defaults to Doctrine's
``dbname`` connection parameter value.
- ``service`` (boolean): Whether to use Oracle's ``SERVICE_NAME``
connection parameter in favour of ``SID`` when connecting. The
value for this will be read from Doctrine's ``servicename`` if
given, ``dbname`` otherwise.
- ``pooled`` (boolean): Whether to enable database resident
connection pooling.
- ``charset`` (string): The charset used when connecting to the
...
...
lib/Doctrine/DBAL/Driver/OCI8/Driver.php
View file @
e0e5bf49
...
...
@@ -66,18 +66,24 @@ class Driver implements \Doctrine\DBAL\Driver
$dsn
.=
'(PORT=1521)'
;
}
$database
=
'SID='
.
$params
[
'dbname'
];
$serviceName
=
$params
[
'dbname'
];
if
(
!
empty
(
$params
[
'servicename'
]))
{
$serviceName
=
$params
[
'servicename'
];
}
$service
=
'SID='
.
$serviceName
;
$pooled
=
''
;
if
(
isset
(
$params
[
'service'
])
&&
$params
[
'service'
]
==
true
)
{
$
database
=
'SERVICE_NAME='
.
$params
[
'dbname'
]
;
$
service
=
'SERVICE_NAME='
.
$serviceName
;
}
if
(
isset
(
$params
[
'pooled'
])
&&
$params
[
'pooled'
]
==
true
)
{
$pooled
=
'(SERVER=POOLED)'
;
}
$dsn
.=
'))(CONNECT_DATA=('
.
$
databas
e
.
')'
.
$pooled
.
'))'
;
$dsn
.=
'))(CONNECT_DATA=('
.
$
servic
e
.
')'
.
$pooled
.
'))'
;
}
else
{
$dsn
.=
$params
[
'dbname'
];
}
...
...
lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php
View file @
e0e5bf49
...
...
@@ -68,18 +68,24 @@ class Driver implements \Doctrine\DBAL\Driver
$dsn
.=
'(PORT=1521)'
;
}
$database
=
'SID='
.
$params
[
'dbname'
];
$pooled
=
''
;
$serviceName
=
$params
[
'dbname'
];
if
(
!
empty
(
$params
[
'servicename'
]))
{
$serviceName
=
$params
[
'servicename'
];
}
$service
=
'SID='
.
$serviceName
;
$pooled
=
''
;
if
(
isset
(
$params
[
'service'
])
&&
$params
[
'service'
]
==
true
)
{
$
database
=
'SERVICE_NAME='
.
$params
[
'dbname'
]
;
$
service
=
'SERVICE_NAME='
.
$serviceName
;
}
if
(
isset
(
$params
[
'pooled'
])
&&
$params
[
'pooled'
]
==
true
)
{
$pooled
=
'(SERVER=POOLED)'
;
}
$dsn
.=
'))(CONNECT_DATA=('
.
$
databas
e
.
')'
.
$pooled
.
'))'
;
$dsn
.=
'))(CONNECT_DATA=('
.
$
servic
e
.
')'
.
$pooled
.
'))'
;
}
else
{
$dsn
.=
$params
[
'dbname'
];
}
...
...
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