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
7894217c
Commit
7894217c
authored
Aug 06, 2012
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed method names.
parent
a9003015
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
HelpController.php
framework/console/commands/HelpController.php
+7
-6
No files found.
framework/console/commands/HelpController.php
View file @
7894217c
...
@@ -50,7 +50,7 @@ class HelpController extends Controller
...
@@ -50,7 +50,7 @@ class HelpController extends Controller
public
function
actionIndex
(
$args
=
array
())
public
function
actionIndex
(
$args
=
array
())
{
{
if
(
empty
(
$args
))
{
if
(
empty
(
$args
))
{
$status
=
$this
->
helpIndex
();
$status
=
$this
->
getHelp
();
}
else
{
}
else
{
$result
=
\Yii
::
$application
->
createController
(
$args
[
0
]);
$result
=
\Yii
::
$application
->
createController
(
$args
[
0
]);
if
(
$result
===
false
)
{
if
(
$result
===
false
)
{
...
@@ -61,9 +61,9 @@ class HelpController extends Controller
...
@@ -61,9 +61,9 @@ class HelpController extends Controller
list
(
$controller
,
$action
)
=
$result
;
list
(
$controller
,
$action
)
=
$result
;
if
(
$action
===
''
)
{
if
(
$action
===
''
)
{
$status
=
$this
->
helpController
(
$controller
);
$status
=
$this
->
getControllerHelp
(
$controller
);
}
else
{
}
else
{
$status
=
$this
->
helpAction
(
$controller
,
$action
);
$status
=
$this
->
getActionHelp
(
$controller
,
$action
);
}
}
}
}
return
$status
;
return
$status
;
...
@@ -90,6 +90,7 @@ class HelpController extends Controller
...
@@ -90,6 +90,7 @@ class HelpController extends Controller
$actions
=
array_keys
(
$controller
->
actions
);
$actions
=
array_keys
(
$controller
->
actions
);
$class
=
new
\ReflectionClass
(
$controller
);
$class
=
new
\ReflectionClass
(
$controller
);
foreach
(
$class
->
getMethods
()
as
$method
)
{
foreach
(
$class
->
getMethods
()
as
$method
)
{
/** @var $method \ReflectionMethod */
$name
=
$method
->
getName
();
$name
=
$method
->
getName
();
if
(
$method
->
isPublic
()
&&
!
$method
->
isStatic
()
&&
strpos
(
$name
,
'action'
)
===
0
)
{
if
(
$method
->
isPublic
()
&&
!
$method
->
isStatic
()
&&
strpos
(
$name
,
'action'
)
===
0
)
{
$actions
[]
=
lcfirst
(
substr
(
$name
,
6
));
$actions
[]
=
lcfirst
(
substr
(
$name
,
6
));
...
@@ -140,7 +141,7 @@ class HelpController extends Controller
...
@@ -140,7 +141,7 @@ class HelpController extends Controller
* Displays all available commands.
* Displays all available commands.
* @return integer the exit status
* @return integer the exit status
*/
*/
protected
function
helpIndex
()
protected
function
getHelp
()
{
{
$commands
=
$this
->
getCommands
();
$commands
=
$this
->
getCommands
();
if
(
$commands
!==
array
())
{
if
(
$commands
!==
array
())
{
...
@@ -162,7 +163,7 @@ class HelpController extends Controller
...
@@ -162,7 +163,7 @@ class HelpController extends Controller
* @param Controller $controller the controller instance
* @param Controller $controller the controller instance
* @return integer the exit status
* @return integer the exit status
*/
*/
protected
function
helpController
(
$controller
)
protected
function
getControllerHelp
(
$controller
)
{
{
$class
=
new
\ReflectionClass
(
$controller
);
$class
=
new
\ReflectionClass
(
$controller
);
$comment
=
strtr
(
trim
(
preg_replace
(
'/^\s*\**( |\t)?/m'
,
''
,
trim
(
$class
->
getDocComment
(),
'/'
))),
"
\r
"
,
''
);
$comment
=
strtr
(
trim
(
preg_replace
(
'/^\s*\**( |\t)?/m'
,
''
,
trim
(
$class
->
getDocComment
(),
'/'
))),
"
\r
"
,
''
);
...
@@ -213,7 +214,7 @@ class HelpController extends Controller
...
@@ -213,7 +214,7 @@ class HelpController extends Controller
* @param string $actionID action ID
* @param string $actionID action ID
* @return integer the exit status
* @return integer the exit status
*/
*/
protected
function
helpAction
(
$controller
,
$actionID
)
protected
function
getActionHelp
(
$controller
,
$actionID
)
{
{
$action
=
$controller
->
createAction
(
$actionID
);
$action
=
$controller
->
createAction
(
$actionID
);
if
(
$action
===
null
)
{
if
(
$action
===
null
)
{
...
...
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