Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php
index 8d6e690205..560d4203a0 100644
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php
@@ -1,28 +1,32 @@
<?php
final class PhabricatorXHPASTViewFrameController
extends PhabricatorXHPASTViewController {
private $id;
+ public function shouldAllowPublic() {
+ return true;
+ }
+
public function willProcessRequest(array $data) {
$this->id = $data['id'];
}
public function processRequest() {
$id = $this->id;
return $this->buildStandardPageResponse(
phutil_tag(
'iframe',
array(
'src' => '/xhpast/frameset/'.$id.'/',
'frameborder' => '0',
'style' => 'width: 100%; height: 800px;',
'',
)),
array(
'title' => pht('XHPAST View'),
));
}
}
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php
index 2ca3b17e96..a21bb30b68 100644
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewFramesetController.php
@@ -1,28 +1,32 @@
<?php
final class PhabricatorXHPASTViewFramesetController
extends PhabricatorXHPASTViewController {
private $id;
+ public function shouldAllowPublic() {
+ return true;
+ }
+
public function willProcessRequest(array $data) {
$this->id = $data['id'];
}
public function processRequest() {
$id = $this->id;
$response = new AphrontWebpageResponse();
$response->setFrameable(true);
$response->setContent(phutil_tag(
'frameset',
array('cols' => '33%, 34%, 33%'),
array(
phutil_tag('frame', array('src' => "/xhpast/input/{$id}/")),
phutil_tag('frame', array('src' => "/xhpast/tree/{$id}/")),
phutil_tag('frame', array('src' => "/xhpast/stream/{$id}/")),
)));
return $response;
}
}
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php
index ab68948af3..8f824dc03f 100644
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php
@@ -1,70 +1,74 @@
<?php
abstract class PhabricatorXHPASTViewPanelController
extends PhabricatorXHPASTViewController {
private $id;
private $storageTree;
+ public function shouldAllowPublic() {
+ return true;
+ }
+
public function willProcessRequest(array $data) {
$this->id = $data['id'];
$this->storageTree = id(new PhabricatorXHPASTViewParseTree())
->load($this->id);
if (!$this->storageTree) {
throw new Exception(pht('No such AST!'));
}
}
protected function getStorageTree() {
return $this->storageTree;
}
protected function buildXHPASTViewPanelResponse($content) {
$content = hsprintf(
'<!DOCTYPE html>'.
'<html>'.
'<head>'.
'<style type="text/css">
body {
white-space: pre;
font: 10px "Monaco";
cursor: pointer;
}
.token {
padding: 2px 4px;
margin: 2px 2px;
border: 1px solid #bbbbbb;
line-height: 24px;
}
ul {
margin: 0 0 0 1em;
padding: 0;
list-style: none;
line-height: 1em;
}
li {
margin: 0;
padding: 0;
}
li span {
background: #dddddd;
padding: 3px 6px;
}
</style>'.
'</head>'.
'<body>%s</body>'.
'</html>',
$content);
$response = new AphrontWebpageResponse();
$response->setFrameable(true);
$response->setContent($content);
return $response;
}
}
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php
index b332784e92..7da285f121 100644
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewTreeController.php
@@ -1,45 +1,49 @@
<?php
final class PhabricatorXHPASTViewTreeController
extends PhabricatorXHPASTViewPanelController {
+ public function shouldAllowPublic() {
+ return true;
+ }
+
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

Mime Type
text/x-diff
Expires
Tue, Jun 10, 2:34 PM (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
140414
Default Alt Text
(5 KB)

Event Timeline