Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96360537
PhabricatorXHPASTViewTreeController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Dec 25, 21:49
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Dec 27, 21:49 (1 d, 11 h)
Engine
blob
Format
Raw Data
Handle
23171987
Attached To
rPH Phabricator
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
=
'<ul>'
.
$this
->
buildTree
(
$tree
->
getRootNode
()).
'</ul>'
;
return
$this
->
buildXHPASTViewPanelResponse
(
$tree
);
}
protected
function
buildTree
(
$root
)
{
try
{
$name
=
$root
->
getTypeName
();
$title
=
$root
->
getDescription
();
}
catch
(
Exception
$ex
)
{
$name
=
'???'
;
$title
=
'???'
;
}
$tree
=
array
();
$tree
[]
=
'<li>'
.
phutil_render_tag
(
'span'
,
array
(
'title'
=>
$title
,
),
phutil_escape_html
(
$name
)).
'</li>'
;
foreach
(
$root
->
getChildren
()
as
$child
)
{
$tree
[]
=
'<ul>'
.
$this
->
buildTree
(
$child
).
'</ul>'
;
}
return
implode
(
"
\n
"
,
$tree
);
}
}
Event Timeline
Log In to Comment