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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
43333d9c
Commit
43333d9c
authored
Jul 11, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented master balancing.
parent
91e0c5ae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
9 deletions
+9
-9
Schema.php
extensions/sphinx/Schema.php
+1
-1
Command.php
framework/db/Command.php
+2
-2
Connection.php
framework/db/Connection.php
+0
-0
Schema.php
framework/db/Schema.php
+1
-1
Schema.php
framework/db/cubrid/Schema.php
+3
-3
QueryBuilder.php
framework/db/mssql/QueryBuilder.php
+1
-1
QueryBuilder.php
framework/db/pgsql/QueryBuilder.php
+1
-1
No files found.
extensions/sphinx/Schema.php
View file @
43333d9c
...
...
@@ -324,7 +324,7 @@ class Schema extends Object
public
function
quoteValue
(
$str
)
{
if
(
is_string
(
$str
))
{
return
$this
->
db
->
get
Read
Pdo
()
->
quote
(
$str
);
return
$this
->
db
->
get
Slave
Pdo
()
->
quote
(
$str
);
}
else
{
return
$str
;
}
...
...
framework/db/Command.php
View file @
43333d9c
...
...
@@ -161,9 +161,9 @@ class Command extends \yii\base\Component
$sql
=
$this
->
getSql
();
if
(
$forRead
||
$forRead
===
null
&&
$this
->
db
->
getSchema
()
->
isReadQuery
(
$sql
))
{
$pdo
=
$this
->
db
->
get
Read
Pdo
();
$pdo
=
$this
->
db
->
get
Slave
Pdo
();
}
else
{
$pdo
=
$this
->
db
->
get
Write
Pdo
();
$pdo
=
$this
->
db
->
get
Master
Pdo
();
}
try
{
...
...
framework/db/Connection.php
View file @
43333d9c
This diff is collapsed.
Click to expand it.
framework/db/Schema.php
View file @
43333d9c
...
...
@@ -369,7 +369,7 @@ abstract class Schema extends Object
return
$str
;
}
if
((
$value
=
$this
->
db
->
get
Read
Pdo
()
->
quote
(
$str
))
!==
false
)
{
if
((
$value
=
$this
->
db
->
get
Slave
Pdo
()
->
quote
(
$str
))
!==
false
)
{
return
$value
;
}
else
{
// the driver doesn't support quote (e.g. oci)
...
...
framework/db/cubrid/Schema.php
View file @
43333d9c
...
...
@@ -116,7 +116,7 @@ class Schema extends \yii\db\Schema
return
$str
;
}
$pdo
=
$this
->
db
->
get
Read
Pdo
();
$pdo
=
$this
->
db
->
get
Slave
Pdo
();
// workaround for broken PDO::quote() implementation in CUBRID 9.1.0 http://jira.cubrid.org/browse/APIS-658
$version
=
$pdo
->
getAttribute
(
\PDO
::
ATTR_CLIENT_VERSION
);
...
...
@@ -143,7 +143,7 @@ class Schema extends \yii\db\Schema
*/
protected
function
loadTableSchema
(
$name
)
{
$pdo
=
$this
->
db
->
get
Read
Pdo
();
$pdo
=
$this
->
db
->
get
Slave
Pdo
();
$tableInfo
=
$pdo
->
cubrid_schema
(
\PDO
::
CUBRID_SCH_TABLE
,
$name
);
...
...
@@ -266,7 +266,7 @@ class Schema extends \yii\db\Schema
*/
protected
function
findTableNames
(
$schema
=
''
)
{
$pdo
=
$this
->
db
->
get
Read
Pdo
();
$pdo
=
$this
->
db
->
get
Slave
Pdo
();
$tables
=
$pdo
->
cubrid_schema
(
\PDO
::
CUBRID_SCH_TABLE
);
$tableNames
=
[];
foreach
(
$tables
as
$table
)
{
...
...
framework/db/mssql/QueryBuilder.php
View file @
43333d9c
...
...
@@ -239,7 +239,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
*/
protected
function
isOldMssql
()
{
$pdo
=
$this
->
db
->
get
Read
Pdo
();
$pdo
=
$this
->
db
->
get
Slave
Pdo
();
$version
=
preg_split
(
"/\./"
,
$pdo
->
getAttribute
(
\PDO
::
ATTR_SERVER_VERSION
));
return
$version
[
0
]
<
11
;
}
...
...
framework/db/pgsql/QueryBuilder.php
View file @
43333d9c
...
...
@@ -137,7 +137,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
// enable to have ability to alter several tables
$this
->
db
->
get
Write
Pdo
()
->
setAttribute
(
\PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
db
->
get
Master
Pdo
()
->
setAttribute
(
\PDO
::
ATTR_EMULATE_PREPARES
,
true
);
return
$command
;
}
...
...
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