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
3dbfd3ea
Commit
3dbfd3ea
authored
Nov 01, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gii: renamed action "new" to "create"
parent
986a8b0c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
CodeFile.php
framework/yii/gii/CodeFile.php
+3
-3
Generator.php
framework/yii/gii/Generator.php
+1
-1
files.php
framework/yii/gii/views/default/view/files.php
+1
-1
No files found.
framework/yii/gii/CodeFile.php
View file @
3dbfd3ea
...
...
@@ -28,7 +28,7 @@ class CodeFile extends Object
/**
* The code file is new.
*/
const
OP_
NEW
=
'new
'
;
const
OP_
CREATE
=
'create
'
;
/**
* The code file already exists, and the new one may need to overwrite it.
*/
...
...
@@ -68,7 +68,7 @@ class CodeFile extends Object
if
(
is_file
(
$path
))
{
$this
->
operation
=
file_get_contents
(
$path
)
===
$content
?
self
::
OP_SKIP
:
self
::
OP_OVERWRITE
;
}
else
{
$this
->
operation
=
self
::
OP_
NEW
;
$this
->
operation
=
self
::
OP_
CREATE
;
}
}
...
...
@@ -79,7 +79,7 @@ class CodeFile extends Object
public
function
save
()
{
$module
=
Yii
::
$app
->
controller
->
module
;
if
(
$this
->
operation
===
self
::
OP_
NEW
)
{
if
(
$this
->
operation
===
self
::
OP_
CREATE
)
{
$dir
=
dirname
(
$this
->
path
);
if
(
!
is_dir
(
$dir
))
{
$mask
=
@
umask
(
0
);
...
...
framework/yii/gii/Generator.php
View file @
3dbfd3ea
...
...
@@ -250,7 +250,7 @@ abstract class Generator extends Model
$hasError
=
true
;
$lines
[]
=
"generating
$relativePath
\n
<span class=
\"
error
\"
>
$error
</span>"
;
}
else
{
$lines
[]
=
$file
->
operation
===
CodeFile
::
OP_
NEW
?
" generated
$relativePath
"
:
" overwrote
$relativePath
"
;
$lines
[]
=
$file
->
operation
===
CodeFile
::
OP_
CREATE
?
" generated
$relativePath
"
:
" overwrote
$relativePath
"
;
}
}
else
{
$lines
[]
=
" skipped
$relativePath
"
;
...
...
framework/yii/gii/views/default/view/files.php
View file @
3dbfd3ea
...
...
@@ -53,7 +53,7 @@ use yii\gii\CodeFile;
if
(
$file
->
operation
===
CodeFile
::
OP_SKIP
)
{
echo
' '
;
}
else
{
echo
Html
::
checkBox
(
"answers[
{
$file
->
id
}
]"
,
isset
(
$answers
)
?
isset
(
$answers
[
$file
->
id
])
:
(
$file
->
operation
===
CodeFile
::
OP_
NEW
));
echo
Html
::
checkBox
(
"answers[
{
$file
->
id
}
]"
,
isset
(
$answers
)
?
isset
(
$answers
[
$file
->
id
])
:
(
$file
->
operation
===
CodeFile
::
OP_
CREATE
));
}
?>
</td>
...
...
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