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
e796d1fa
Commit
e796d1fa
authored
Dec 04, 2014
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plain `echo` replaced by `stdout()` at `yii\console\HelpController`
parent
a3af271e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
HelpController.php
framework/console/controllers/HelpController.php
+18
-18
No files found.
framework/console/controllers/HelpController.php
View file @
e796d1fa
...
...
@@ -192,14 +192,14 @@ class HelpController extends Controller
}
}
foreach
(
$commands
as
$command
=>
$description
)
{
echo
"- "
.
$this
->
ansiFormat
(
$command
,
Console
::
FG_YELLOW
);
echo
str_repeat
(
' '
,
$len
+
3
-
strlen
(
$command
))
.
$description
;
echo
"
\n
"
;
$this
->
stdout
(
"- "
.
$this
->
ansiFormat
(
$command
,
Console
::
FG_YELLOW
)
);
$this
->
stdout
(
str_repeat
(
' '
,
$len
+
3
-
strlen
(
$command
))
.
$description
)
;
$this
->
stdout
(
"
\n
"
)
;
}
$scriptName
=
$this
->
getScriptName
();
$this
->
stdout
(
"
\n
To see the help of each command, enter:
\n
"
,
Console
::
BOLD
);
echo
"
\n
$scriptName
"
.
$this
->
ansiFormat
(
'help'
,
Console
::
FG_YELLOW
)
.
' '
.
$this
->
ansiFormat
(
'<command-name>'
,
Console
::
FG_CYAN
)
.
"
\n\n
"
;
$this
->
stdout
(
"
\n
$scriptName
"
.
$this
->
ansiFormat
(
'help'
,
Console
::
FG_YELLOW
)
.
' '
.
$this
->
ansiFormat
(
'<command-name>'
,
Console
::
FG_CYAN
)
.
"
\n\n
"
)
;
}
else
{
$this
->
stdout
(
"
\n
No commands are found.
\n\n
"
,
Console
::
BOLD
);
}
...
...
@@ -224,20 +224,20 @@ class HelpController extends Controller
$this
->
stdout
(
"
\n
SUB-COMMANDS
\n\n
"
,
Console
::
BOLD
);
$prefix
=
$controller
->
getUniqueId
();
foreach
(
$actions
as
$action
)
{
echo
'- '
.
$this
->
ansiFormat
(
$prefix
.
'/'
.
$action
,
Console
::
FG_YELLOW
);
$this
->
stdout
(
'- '
.
$this
->
ansiFormat
(
$prefix
.
'/'
.
$action
,
Console
::
FG_YELLOW
)
);
if
(
$action
===
$controller
->
defaultAction
)
{
$this
->
stdout
(
' (default)'
,
Console
::
FG_GREEN
);
}
$summary
=
$controller
->
getActionHelpSummary
(
$controller
->
createAction
(
$action
));
if
(
$summary
!==
''
)
{
echo
': '
.
$summary
;
$this
->
stdout
(
': '
.
$summary
)
;
}
echo
"
\n
"
;
$this
->
stdout
(
"
\n
"
)
;
}
$scriptName
=
$this
->
getScriptName
();
echo
"
\n
To see the detailed information about individual sub-commands, enter:
\n
"
;
echo
"
\n
$scriptName
"
.
$this
->
ansiFormat
(
'help'
,
Console
::
FG_YELLOW
)
.
' '
.
$this
->
ansiFormat
(
'<sub-command>'
,
Console
::
FG_CYAN
)
.
"
\n\n
"
;
$this
->
stdout
(
"
\n
To see the detailed information about individual sub-commands, enter:
\n
"
)
;
$this
->
stdout
(
"
\n
$scriptName
"
.
$this
->
ansiFormat
(
'help'
,
Console
::
FG_YELLOW
)
.
' '
.
$this
->
ansiFormat
(
'<sub-command>'
,
Console
::
FG_CYAN
)
.
"
\n\n
"
)
;
}
}
...
...
@@ -264,9 +264,9 @@ class HelpController extends Controller
$this
->
stdout
(
"
\n
USAGE
\n\n
"
,
Console
::
BOLD
);
$scriptName
=
$this
->
getScriptName
();
if
(
$action
->
id
===
$controller
->
defaultAction
)
{
echo
$scriptName
.
' '
.
$this
->
ansiFormat
(
$controller
->
getUniqueId
(),
Console
::
FG_YELLOW
);
$this
->
stdout
(
$scriptName
.
' '
.
$this
->
ansiFormat
(
$controller
->
getUniqueId
(),
Console
::
FG_YELLOW
)
);
}
else
{
echo
$scriptName
.
' '
.
$this
->
ansiFormat
(
$action
->
getUniqueId
(),
Console
::
FG_YELLOW
);
$this
->
stdout
(
$scriptName
.
' '
.
$this
->
ansiFormat
(
$action
->
getUniqueId
(),
Console
::
FG_YELLOW
)
);
}
$args
=
$controller
->
getActionArgsHelp
(
$action
);
...
...
@@ -289,28 +289,28 @@ class HelpController extends Controller
if
(
!
empty
(
$options
))
{
$this
->
stdout
(
' [...options...]'
,
Console
::
FG_RED
);
}
echo
"
\n\n
"
;
$this
->
stdout
(
"
\n\n
"
)
;
if
(
!
empty
(
$args
))
{
foreach
(
$args
as
$name
=>
$arg
)
{
echo
$this
->
formatOptionHelp
(
$this
->
stdout
(
$this
->
formatOptionHelp
(
'- '
.
$this
->
ansiFormat
(
$name
,
Console
::
FG_CYAN
),
$arg
[
'required'
],
$arg
[
'type'
],
$arg
[
'default'
],
$arg
[
'comment'
])
.
"
\n\n
"
;
$arg
[
'comment'
])
.
"
\n\n
"
)
;
}
}
if
(
!
empty
(
$options
))
{
$this
->
stdout
(
"
\n
OPTIONS
\n\n
"
,
Console
::
BOLD
);
foreach
(
$options
as
$name
=>
$option
)
{
echo
$this
->
formatOptionHelp
(
$this
->
stdout
(
$this
->
formatOptionHelp
(
$this
->
ansiFormat
(
'--'
.
$name
,
Console
::
FG_RED
,
empty
(
$option
[
'required'
])
?
Console
::
FG_RED
:
Console
::
BOLD
),
!
empty
(
$option
[
'required'
]),
$option
[
'type'
],
$option
[
'default'
],
$option
[
'comment'
])
.
"
\n\n
"
;
$option
[
'comment'
])
.
"
\n\n
"
)
;
}
}
}
...
...
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