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
8c50ee9e
Commit
8c50ee9e
authored
Oct 16, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5613: Added `--overwrite` option to Gii console command to support overwriting all files
Fixed the bug that Gii console command help information does not contain global options
parent
2d31f9f6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
12 deletions
+24
-12
CHANGELOG.md
extensions/gii/CHANGELOG.md
+2
-1
GenerateAction.php
extensions/gii/console/GenerateAction.php
+1
-1
GenerateController.php
extensions/gii/console/GenerateController.php
+19
-10
CHANGELOG.md
framework/CHANGELOG.md
+2
-0
No files found.
extensions/gii/CHANGELOG.md
View file @
8c50ee9e
...
...
@@ -4,7 +4,8 @@ Yii Framework 2 gii extension Change Log
2.
0.1 under development
-----------------------
-
no changes in this release.
-
Enh #5613: Added
`--overwrite`
option to Gii console command to support overwriting all files (motin, qiangxue)
-
Bug: Gii console command help information does not contain global options (qiangxue)
2.0.0 October 12, 2014
...
...
extensions/gii/console/GenerateAction.php
View file @
8c50ee9e
...
...
@@ -56,7 +56,7 @@ class GenerateAction extends \yii\base\Action
return
;
}
echo
"The following files will be generated:
\n
"
;
$skipAll
=
$this
->
controller
->
interactive
?
null
:
tru
e
;
$skipAll
=
$this
->
controller
->
interactive
?
null
:
!
$this
->
controller
->
overwrit
e
;
$answers
=
[];
foreach
(
$files
as
$file
)
{
$path
=
$file
->
getRelativePath
();
...
...
extensions/gii/console/GenerateController.php
View file @
8c50ee9e
...
...
@@ -32,6 +32,12 @@ class GenerateController extends Controller
*/
public
$module
;
/**
* @var boolean whether to overwrite all existing code files when in non-interactive mode.
* Defaults to false, meaning none of the existing code files will be overwritten.
* This option is used only when `--interactive=0`.
*/
public
$overwrite
=
false
;
/**
* @var array a list of the available code generators
*/
public
$generators
=
[];
...
...
@@ -115,16 +121,19 @@ class GenerateController extends Controller
*/
public
function
options
(
$id
)
{
if
(
isset
(
$this
->
generators
[
$id
]))
{
$attributes
=
$this
->
generators
[
$id
]
->
attributes
;
unset
(
$attributes
[
'templates'
]);
return
array_merge
(
parent
::
options
(
$id
),
array_keys
(
$attributes
)
);
}
else
{
return
parent
::
options
(
$id
);
$options
=
parent
::
options
(
$id
);
$options
[]
=
'overwrite'
;
if
(
!
isset
(
$this
->
generators
[
$id
]))
{
return
$options
;
}
$attributes
=
$this
->
generators
[
$id
]
->
attributes
;
unset
(
$attributes
[
'templates'
]);
return
array_merge
(
$options
,
array_keys
(
$attributes
)
);
}
/**
...
...
@@ -175,7 +184,7 @@ class GenerateController extends Controller
unset
(
$attributes
[
'templates'
]);
$hints
=
$action
->
generator
->
hints
();
$options
=
[]
;
$options
=
parent
::
getActionOptionsHelp
(
$action
)
;
foreach
(
$attributes
as
$name
=>
$value
)
{
$type
=
gettype
(
$value
);
$options
[
$name
]
=
[
...
...
framework/CHANGELOG.md
View file @
8c50ee9e
...
...
@@ -5,7 +5,9 @@ Yii Framework 2 Change Log
-----------------------
-
Enh #5600: Allow configuring debug panels in
`yii\debug\Module::panels`
as panel class name strings (qiangxue)
-
Enh #5613: Added
`--overwrite`
option to Gii console command to support overwriting all files (motin, qiangxue)
-
Bug #5584:
`yii\rbac\DbRbacManager`
should not delete items when deleting a rule on a database not supporting cascade update (mdmunir)
-
Bug: Gii console command help information does not contain global options (qiangxue)
2.0.0 October 12, 2014
...
...
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