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
cc0fe1b0
Commit
cc0fe1b0
authored
Jun 13, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code style fixes
parent
17b1e5d2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
8 deletions
+5
-8
Migration.php
framework/yii/db/Migration.php
+1
-1
QueryBuilder.php
framework/yii/db/QueryBuilder.php
+3
-4
QueryBuilder.php
framework/yii/db/sqlite/QueryBuilder.php
+0
-1
PhpManager.php
framework/yii/rbac/PhpManager.php
+1
-2
No files found.
framework/yii/db/Migration.php
View file @
cc0fe1b0
...
...
@@ -318,7 +318,7 @@ class Migration extends \yii\base\Component
*/
public
function
addPrimaryKey
(
$name
,
$table
,
$columns
)
{
echo
" > add primary key
$name
on
$table
("
.
(
is_array
(
$columns
)
?
implode
(
','
,
$columns
)
:
$columns
)
.
") ..."
;
echo
" > add primary key
$name
on
$table
("
.
(
is_array
(
$columns
)
?
implode
(
','
,
$columns
)
:
$columns
)
.
") ..."
;
$time
=
microtime
(
true
);
$this
->
db
->
createCommand
()
->
addPrimaryKey
(
$name
,
$table
,
$columns
)
->
execute
();
echo
" done (time: "
.
sprintf
(
'%.3f'
,
microtime
(
true
)
-
$time
)
.
"s)
\n
"
;
...
...
framework/yii/db/QueryBuilder.php
View file @
cc0fe1b0
...
...
@@ -279,11 +279,11 @@ class QueryBuilder extends \yii\base\Object
public
function
addPrimaryKey
(
$name
,
$table
,
$columns
)
{
if
(
is_string
(
$columns
))
{
$columns
=
preg_split
(
'/\s*,\s*/'
,
$columns
,
-
1
,
PREG_SPLIT_NO_EMPTY
);
$columns
=
preg_split
(
'/\s*,\s*/'
,
$columns
,
-
1
,
PREG_SPLIT_NO_EMPTY
);
}
foreach
(
$columns
as
$i
=>
$col
)
{
$columns
[
$i
]
=
$this
->
db
->
quoteColumnName
(
$col
);
foreach
(
$columns
as
$i
=>
$col
)
{
$columns
[
$i
]
=
$this
->
db
->
quoteColumnName
(
$col
);
}
return
'ALTER TABLE '
.
$this
->
db
->
quoteTableName
(
$table
)
.
' ADD CONSTRAINT '
...
...
@@ -301,7 +301,6 @@ class QueryBuilder extends \yii\base\Object
{
return
'ALTER TABLE '
.
$this
->
db
->
quoteTableName
(
$table
)
.
' DROP CONSTRAINT '
.
$this
->
db
->
quoteColumnName
(
$name
);
}
/**
...
...
framework/yii/db/sqlite/QueryBuilder.php
View file @
cc0fe1b0
...
...
@@ -205,4 +205,3 @@ class QueryBuilder extends \yii\db\QueryBuilder
throw
new
NotSupportedException
(
__METHOD__
.
' is not supported by SQLite.'
);
}
}
framework/yii/rbac/PhpManager.php
View file @
cc0fe1b0
...
...
@@ -356,8 +356,7 @@ class PhpManager extends Manager
*/
public
function
saveItem
(
$item
,
$oldName
=
null
)
{
if
(
$oldName
!==
null
&&
(
$newName
=
$item
->
getName
())
!==
$oldName
)
// name changed
{
if
(
$oldName
!==
null
&&
(
$newName
=
$item
->
getName
())
!==
$oldName
)
{
// name changed
if
(
isset
(
$this
->
_items
[
$newName
]))
{
throw
new
InvalidParamException
(
"Unable to change the item name. The name '
$newName
' is already used by another item."
);
}
...
...
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