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
334e298b
Unverified
Commit
334e298b
authored
Jun 19, 2020
by
Sergei Morozov
Committed by
GitHub
Jun 19, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4092 from morozov/remove-connection-is-connected
Remove Connection::$isConnected
parents
17389361
2cedd229
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
Connection.php
lib/Doctrine/DBAL/Connection.php
+5
-16
No files found.
lib/Doctrine/DBAL/Connection.php
View file @
334e298b
...
...
@@ -98,13 +98,6 @@ class Connection implements DriverConnection
/** @var ExpressionBuilder */
protected
$_expr
;
/**
* Whether or not a connection has been established.
*
* @var bool
*/
private
$isConnected
=
false
;
/**
* The current auto-commit mode of this connection.
*
...
...
@@ -192,8 +185,7 @@ class Connection implements DriverConnection
$this
->
params
=
$params
;
if
(
isset
(
$params
[
'pdo'
]))
{
$this
->
_conn
=
$params
[
'pdo'
];
$this
->
isConnected
=
true
;
$this
->
_conn
=
$params
[
'pdo'
];
unset
(
$this
->
params
[
'pdo'
]);
}
...
...
@@ -356,7 +348,7 @@ class Connection implements DriverConnection
*/
public
function
connect
()
{
if
(
$this
->
isConnected
)
{
if
(
$this
->
_conn
!==
null
)
{
return
false
;
}
...
...
@@ -364,8 +356,7 @@ class Connection implements DriverConnection
$user
=
$this
->
params
[
'user'
]
??
null
;
$password
=
$this
->
params
[
'password'
]
??
null
;
$this
->
_conn
=
$this
->
_driver
->
connect
(
$this
->
params
,
$user
,
$password
,
$driverOptions
);
$this
->
isConnected
=
true
;
$this
->
_conn
=
$this
->
_driver
->
connect
(
$this
->
params
,
$user
,
$password
,
$driverOptions
);
$this
->
transactionNestingLevel
=
0
;
...
...
@@ -524,7 +515,7 @@ class Connection implements DriverConnection
$this
->
autoCommit
=
$autoCommit
;
// Commit all currently active transactions if any when switching auto-commit mode.
if
(
$this
->
isConnected
!==
true
||
$this
->
transactionNestingLevel
===
0
)
{
if
(
$this
->
_conn
===
null
||
$this
->
transactionNestingLevel
===
0
)
{
return
;
}
...
...
@@ -689,7 +680,7 @@ class Connection implements DriverConnection
*/
public
function
isConnected
()
{
return
$this
->
isConnected
;
return
$this
->
_conn
!==
null
;
}
/**
...
...
@@ -771,8 +762,6 @@ class Connection implements DriverConnection
public
function
close
()
{
$this
->
_conn
=
null
;
$this
->
isConnected
=
false
;
}
/**
...
...
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