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
Hide 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
...
@@ -28,7 +28,7 @@ class CodeFile extends Object
/**
/**
* The code file is new.
* 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.
* The code file already exists, and the new one may need to overwrite it.
*/
*/
...
@@ -68,7 +68,7 @@ class CodeFile extends Object
...
@@ -68,7 +68,7 @@ class CodeFile extends Object
if
(
is_file
(
$path
))
{
if
(
is_file
(
$path
))
{
$this
->
operation
=
file_get_contents
(
$path
)
===
$content
?
self
::
OP_SKIP
:
self
::
OP_OVERWRITE
;
$this
->
operation
=
file_get_contents
(
$path
)
===
$content
?
self
::
OP_SKIP
:
self
::
OP_OVERWRITE
;
}
else
{
}
else
{
$this
->
operation
=
self
::
OP_
NEW
;
$this
->
operation
=
self
::
OP_
CREATE
;
}
}
}
}
...
@@ -79,7 +79,7 @@ class CodeFile extends Object
...
@@ -79,7 +79,7 @@ class CodeFile extends Object
public
function
save
()
public
function
save
()
{
{
$module
=
Yii
::
$app
->
controller
->
module
;
$module
=
Yii
::
$app
->
controller
->
module
;
if
(
$this
->
operation
===
self
::
OP_
NEW
)
{
if
(
$this
->
operation
===
self
::
OP_
CREATE
)
{
$dir
=
dirname
(
$this
->
path
);
$dir
=
dirname
(
$this
->
path
);
if
(
!
is_dir
(
$dir
))
{
if
(
!
is_dir
(
$dir
))
{
$mask
=
@
umask
(
0
);
$mask
=
@
umask
(
0
);
...
...
framework/yii/gii/Generator.php
View file @
3dbfd3ea
...
@@ -250,7 +250,7 @@ abstract class Generator extends Model
...
@@ -250,7 +250,7 @@ abstract class Generator extends Model
$hasError
=
true
;
$hasError
=
true
;
$lines
[]
=
"generating
$relativePath
\n
<span class=
\"
error
\"
>
$error
</span>"
;
$lines
[]
=
"generating
$relativePath
\n
<span class=
\"
error
\"
>
$error
</span>"
;
}
else
{
}
else
{
$lines
[]
=
$file
->
operation
===
CodeFile
::
OP_
NEW
?
" generated
$relativePath
"
:
" overwrote
$relativePath
"
;
$lines
[]
=
$file
->
operation
===
CodeFile
::
OP_
CREATE
?
" generated
$relativePath
"
:
" overwrote
$relativePath
"
;
}
}
}
else
{
}
else
{
$lines
[]
=
" skipped
$relativePath
"
;
$lines
[]
=
" skipped
$relativePath
"
;
...
...
framework/yii/gii/views/default/view/files.php
View file @
3dbfd3ea
...
@@ -53,7 +53,7 @@ use yii\gii\CodeFile;
...
@@ -53,7 +53,7 @@ use yii\gii\CodeFile;
if
(
$file
->
operation
===
CodeFile
::
OP_SKIP
)
{
if
(
$file
->
operation
===
CodeFile
::
OP_SKIP
)
{
echo
' '
;
echo
' '
;
}
else
{
}
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>
</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