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
60db9518
Commit
60db9518
authored
Jan 05, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
console HelpController use correct script name
parent
f8938a2b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
HelpController.php
framework/yii/console/controllers/HelpController.php
+15
-9
No files found.
framework/yii/console/controllers/HelpController.php
View file @
60db9518
...
@@ -42,11 +42,6 @@ class HelpController extends Controller
...
@@ -42,11 +42,6 @@ class HelpController extends Controller
* Displays available commands or the detailed information
* Displays available commands or the detailed information
* about a particular command. For example,
* about a particular command. For example,
*
*
* ~~~
* yii help # list available commands
* yii help message # display help info about "message"
* ~~~
*
* @param string $command The name of the command to show help about.
* @param string $command The name of the command to show help about.
* If not provided, all available commands will be displayed.
* If not provided, all available commands will be displayed.
* @return integer the exit status
* @return integer the exit status
...
@@ -149,8 +144,9 @@ class HelpController extends Controller
...
@@ -149,8 +144,9 @@ class HelpController extends Controller
foreach
(
$commands
as
$command
)
{
foreach
(
$commands
as
$command
)
{
echo
"- "
.
$this
->
ansiFormat
(
$command
,
Console
::
FG_YELLOW
)
.
"
\n
"
;
echo
"- "
.
$this
->
ansiFormat
(
$command
,
Console
::
FG_YELLOW
)
.
"
\n
"
;
}
}
$scriptName
=
$this
->
getScriptName
();
$this
->
stdout
(
"
\n
To see the help of each command, enter:
\n
"
,
Console
::
BOLD
);
$this
->
stdout
(
"
\n
To see the help of each command, enter:
\n
"
,
Console
::
BOLD
);
echo
"
\n
yii
"
.
$this
->
ansiFormat
(
'help'
,
Console
::
FG_YELLOW
)
.
' '
echo
"
\n
$scriptName
"
.
$this
->
ansiFormat
(
'help'
,
Console
::
FG_YELLOW
)
.
' '
.
$this
->
ansiFormat
(
'<command-name>'
,
Console
::
FG_CYAN
)
.
"
\n\n
"
;
.
$this
->
ansiFormat
(
'<command-name>'
,
Console
::
FG_CYAN
)
.
"
\n\n
"
;
}
else
{
}
else
{
$this
->
stdout
(
"
\n
No commands are found.
\n\n
"
,
Console
::
BOLD
);
$this
->
stdout
(
"
\n
No commands are found.
\n\n
"
,
Console
::
BOLD
);
...
@@ -189,8 +185,9 @@ class HelpController extends Controller
...
@@ -189,8 +185,9 @@ class HelpController extends Controller
}
}
echo
"
\n
"
;
echo
"
\n
"
;
}
}
$scriptName
=
$this
->
getScriptName
();
echo
"
\n
To see the detailed information about individual sub-commands, enter:
\n
"
;
echo
"
\n
To see the detailed information about individual sub-commands, enter:
\n
"
;
echo
"
\n
yii
"
.
$this
->
ansiFormat
(
'help'
,
Console
::
FG_YELLOW
)
.
' '
echo
"
\n
$scriptName
"
.
$this
->
ansiFormat
(
'help'
,
Console
::
FG_YELLOW
)
.
' '
.
$this
->
ansiFormat
(
'<sub-command>'
,
Console
::
FG_CYAN
)
.
"
\n\n
"
;
.
$this
->
ansiFormat
(
'<sub-command>'
,
Console
::
FG_CYAN
)
.
"
\n\n
"
;
}
}
}
}
...
@@ -261,10 +258,11 @@ class HelpController extends Controller
...
@@ -261,10 +258,11 @@ class HelpController extends Controller
}
}
$this
->
stdout
(
"
\n
USAGE
\n\n
"
,
Console
::
BOLD
);
$this
->
stdout
(
"
\n
USAGE
\n\n
"
,
Console
::
BOLD
);
$scriptName
=
$this
->
getScriptName
();
if
(
$action
->
id
===
$controller
->
defaultAction
)
{
if
(
$action
->
id
===
$controller
->
defaultAction
)
{
echo
'yii
'
.
$this
->
ansiFormat
(
$controller
->
getUniqueId
(),
Console
::
FG_YELLOW
);
echo
$scriptName
.
'
'
.
$this
->
ansiFormat
(
$controller
->
getUniqueId
(),
Console
::
FG_YELLOW
);
}
else
{
}
else
{
echo
'yii
'
.
$this
->
ansiFormat
(
$action
->
getUniqueId
(),
Console
::
FG_YELLOW
);
echo
$scriptName
.
'
'
.
$this
->
ansiFormat
(
$action
->
getUniqueId
(),
Console
::
FG_YELLOW
);
}
}
list
(
$required
,
$optional
)
=
$this
->
getArgHelps
(
$method
,
isset
(
$tags
[
'param'
])
?
$tags
[
'param'
]
:
[]);
list
(
$required
,
$optional
)
=
$this
->
getArgHelps
(
$method
,
isset
(
$tags
[
'param'
])
?
$tags
[
'param'
]
:
[]);
foreach
(
$required
as
$arg
=>
$description
)
{
foreach
(
$required
as
$arg
=>
$description
)
{
...
@@ -425,4 +423,12 @@ class HelpController extends Controller
...
@@ -425,4 +423,12 @@ class HelpController extends Controller
$name
=
$required
?
"
$name
(required)"
:
$name
;
$name
=
$required
?
"
$name
(required)"
:
$name
;
return
$doc
===
''
?
$name
:
"
$name
:
$doc
"
;
return
$doc
===
''
?
$name
:
"
$name
:
$doc
"
;
}
}
/**
* @return string the name of the cli script currently running.
*/
protected
function
getScriptName
()
{
return
basename
(
Yii
::
$app
->
request
->
scriptFile
);
}
}
}
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