Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
PSDI Army
yii2
Commits
4a552c88
Commit
4a552c88
authored
Dec 27, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1650: Added Connection::pdoClass.
parent
fdca106e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Connection.php
framework/yii/db/Connection.php
+8
-1
No files found.
framework/CHANGELOG.md
View file @
4a552c88
...
@@ -35,6 +35,7 @@ Yii Framework 2 Change Log
...
@@ -35,6 +35,7 @@ Yii Framework 2 Change Log
-
Enh #1634: Use masked CSRF tokens to prevent BREACH exploits (qiangxue)
-
Enh #1634: Use masked CSRF tokens to prevent BREACH exploits (qiangxue)
-
Enh #1641: Added
`BaseActiveRecord::updateAttributes()`
(qiangxue)
-
Enh #1641: Added
`BaseActiveRecord::updateAttributes()`
(qiangxue)
-
Enh #1646: Added postgresql
`QueryBuilder::checkIntegrity`
and
`QueryBuilder::resetSequence`
(Ragazzo)
-
Enh #1646: Added postgresql
`QueryBuilder::checkIntegrity`
and
`QueryBuilder::resetSequence`
(Ragazzo)
-
Enh #1645: Added
`Connection::$pdoClass`
property (Ragazzo)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to defauly application templates (samdark)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to defauly application templates (samdark)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Support for file aliases in console command 'message' (omnilight)
-
Enh: Support for file aliases in console command 'message' (omnilight)
...
...
framework/yii/db/Connection.php
View file @
4a552c88
...
@@ -253,7 +253,10 @@ class Connection extends Component
...
@@ -253,7 +253,10 @@ class Connection extends Component
* @var Schema the database schema
* @var Schema the database schema
*/
*/
private
$_schema
;
private
$_schema
;
/**
* @var string Custom PDO wrapper class. If not set, it will use "PDO" or "yii\db\mssql\PDO" when MSSQL is used.
*/
public
$pdoClass
;
/**
/**
* Returns a value indicating whether the DB connection is established.
* Returns a value indicating whether the DB connection is established.
...
@@ -338,6 +341,8 @@ class Connection extends Component
...
@@ -338,6 +341,8 @@ class Connection extends Component
*/
*/
protected
function
createPdoInstance
()
protected
function
createPdoInstance
()
{
{
$pdoClass
=
$this
->
pdoClass
;
if
(
$pdoClass
===
null
)
{
$pdoClass
=
'PDO'
;
$pdoClass
=
'PDO'
;
if
((
$pos
=
strpos
(
$this
->
dsn
,
':'
))
!==
false
)
{
if
((
$pos
=
strpos
(
$this
->
dsn
,
':'
))
!==
false
)
{
$driver
=
strtolower
(
substr
(
$this
->
dsn
,
0
,
$pos
));
$driver
=
strtolower
(
substr
(
$this
->
dsn
,
0
,
$pos
));
...
@@ -345,6 +350,8 @@ class Connection extends Component
...
@@ -345,6 +350,8 @@ class Connection extends Component
$pdoClass
=
'yii\db\mssql\PDO'
;
$pdoClass
=
'yii\db\mssql\PDO'
;
}
}
}
}
}
return
new
$pdoClass
(
$this
->
dsn
,
$this
->
username
,
$this
->
password
,
$this
->
attributes
);
return
new
$pdoClass
(
$this
->
dsn
,
$this
->
username
,
$this
->
password
,
$this
->
attributes
);
}
}
...
...
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