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
f37a88ed
Unverified
Commit
f37a88ed
authored
Jan 01, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.10'
parents
3e735a81
70666011
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
9 deletions
+38
-9
.appveyor.yml
.appveyor.yml
+0
-1
.travis.yml
.travis.yml
+4
-2
configuration.rst
docs/en/reference/configuration.rst
+2
-4
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+7
-1
StatementTest.php
...trine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php
+25
-1
No files found.
.appveyor.yml
View file @
f37a88ed
...
...
@@ -113,7 +113,6 @@ install:
}
# install composer dependencies
-
cd C:\projects\dbal
-
rm composer.lock
-
appveyor-retry composer self-update
-
appveyor-retry composer install --no-progress --prefer-dist
...
...
.travis.yml
View file @
f37a88ed
...
...
@@ -17,8 +17,7 @@ before_script:
-
if [[ "$DB" == "mysql" || "$DB" == "mysqli" || "$DB" == *"mariadb"* ]]; then mysql < tests/travis/create-mysql-schema.sql; fi;
install
:
-
rm composer.lock
-
travis_retry composer -n update --prefer-dist
-
travis_retry composer -n install --prefer-dist
script
:
-
|
...
...
@@ -311,3 +310,6 @@ jobs:
install
:
-
composer config minimum-stability dev
-
travis_retry composer update --prefer-dist
allow_failures
:
-
env
:
DEPENDENCIES=dev
docs/en/reference/configuration.rst
View file @
f37a88ed
...
...
@@ -10,7 +10,6 @@ You can get a DBAL Connection through the
.. code-block:: php
<?php
$config = new \Doctrine\DBAL\Configuration();
//..
$connectionParams = array(
'dbname' => 'mydb',
...
...
@@ -19,19 +18,18 @@ You can get a DBAL Connection through the
'host' => 'localhost',
'driver' => 'pdo_mysql',
);
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams
, $config
);
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
Or, using the simpler URL form:
.. code-block:: php
<?php
$config = new \Doctrine\DBAL\Configuration();
//..
$connectionParams = array(
'url' => 'mysql://user:secret@localhost/mydb',
);
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams
, $config
);
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
The ``DriverManager`` returns an instance of
``Doctrine\DBAL\Connection`` which is a wrapper around the
...
...
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
f37a88ed
...
...
@@ -273,7 +273,13 @@ class OCI8Statement implements IteratorAggregate, Statement
*/
public
function
bindParam
(
$param
,
&
$variable
,
int
$type
=
ParameterType
::
STRING
,
?
int
$length
=
null
)
:
void
{
$param
=
$this
->
_paramMap
[
$param
];
if
(
is_int
(
$param
))
{
if
(
!
isset
(
$this
->
_paramMap
[
$param
]))
{
throw
new
OCI8Exception
(
sprintf
(
'Could not find variable mapping with index %d, in the SQL statement'
,
$param
));
}
$param
=
$this
->
_paramMap
[
$param
];
}
if
(
$type
===
ParameterType
::
LARGE_OBJECT
)
{
$lob
=
oci_new_descriptor
(
$this
->
_dbh
,
OCI_D_LOB
);
...
...
tests/Doctrine/Tests/DBAL/Functional/Driver/OCI8/StatementTest.php
View file @
f37a88ed
...
...
@@ -39,17 +39,41 @@ class StatementTest extends DbalFunctionalTestCase
);
}
/**
* Low-level approach to working with parameter binding
*
* @param mixed[] $params
* @param mixed[] $expected
*
* @dataProvider queryConversionProvider
*/
public
function
testStatementBindParameters
(
string
$query
,
array
$params
,
array
$expected
)
:
void
{
$stmt
=
$this
->
connection
->
prepare
(
$query
);
$stmt
->
execute
(
$params
);
self
::
assertEquals
(
$expected
,
$stmt
->
fetch
()
);
}
/**
* @return array<string, array<int, mixed>>
*/
public
static
function
queryConversionProvider
()
:
iterable
{
return
[
'
simple
'
=>
[
'
positional
'
=>
[
'SELECT ? COL1 FROM DUAL'
,
[
1
],
[
'COL1'
=>
1
],
],
'named'
=>
[
'SELECT :COL COL1 FROM DUAL'
,
[
':COL'
=>
1
],
[
'COL1'
=>
1
],
],
'literal-with-placeholder'
=>
[
"SELECT '?' COL1, ? COL2 FROM DUAL"
,
[
2
],
...
...
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