Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109566851
PhabricatorXHPASTViewStreamController.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
Tue, Apr 22, 11:52
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Apr 24, 11:52 (2 d)
Engine
blob
Format
Raw Data
Handle
25717195
Attached To
rPH Phabricator
PhabricatorXHPASTViewStreamController.php
View Options
<?php
final
class
PhabricatorXHPASTViewStreamController
extends
PhabricatorXHPASTViewPanelController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$storage
=
$this
->
getStorageTree
();
$input
=
$storage
->
getInput
();
$err
=
$storage
->
getReturnCode
();
$stdout
=
$storage
->
getStdout
();
$stderr
=
$storage
->
getStderr
();
try
{
$tree
=
XHPASTTree
::
newFromDataAndResolvedExecFuture
(
$input
,
array
(
$err
,
$stdout
,
$stderr
));
}
catch
(
XHPASTSyntaxErrorException
$ex
)
{
return
$this
->
buildXHPASTViewPanelResponse
(
$ex
->
getMessage
());
}
$tokens
=
array
();
foreach
(
$tree
->
getRawTokenStream
()
as
$id
=>
$token
)
{
$seq
=
$id
;
$name
=
$token
->
getTypeName
();
$title
=
pht
(
'Token %s: %s'
,
$seq
,
$name
);
$tokens
[]
=
phutil_tag
(
'span'
,
array
(
'title'
=>
$title
,
'class'
=>
'token'
,
),
$token
->
getValue
());
}
return
$this
->
buildXHPASTViewPanelResponse
(
phutil_implode_html
(
''
,
$tokens
));
}
}
Event Timeline
Log In to Comment