Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F424942
PhabricatorXHPASTViewTreeController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorXHPASTViewTreeController.php
View Options
<?php
final
class
PhabricatorXHPASTViewTreeController
extends
PhabricatorXHPASTViewPanelController
{
public
function
processRequest
()
{
$storage
=
$this
->
getStorageTree
();
$input
=
$storage
->
getInput
();
$stdout
=
$storage
->
getStdout
();
$tree
=
XHPASTTree
::
newFromDataAndResolvedExecFuture
(
$input
,
array
(
0
,
$stdout
,
''
));
$tree
=
phutil_tag
(
'ul'
,
array
(),
$this
->
buildTree
(
$tree
->
getRootNode
()));
return
$this
->
buildXHPASTViewPanelResponse
(
$tree
);
}
protected
function
buildTree
(
$root
)
{
try
{
$name
=
$root
->
getTypeName
();
$title
=
$root
->
getDescription
();
}
catch
(
Exception
$ex
)
{
$name
=
'???'
;
$title
=
'???'
;
}
$tree
=
array
();
$tree
[]
=
phutil_tag
(
'li'
,
array
(),
phutil_tag
(
'span'
,
array
(
'title'
=>
$title
,
),
$name
));
foreach
(
$root
->
getChildren
()
as
$child
)
{
$tree
[]
=
phutil_tag
(
'ul'
,
array
(),
$this
->
buildTree
(
$child
));
}
return
phutil_implode_html
(
"
\n
"
,
$tree
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, May 2, 10:52 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
57445
Default Alt Text
PhabricatorXHPASTViewTreeController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment