Differential D14028 Diff 34906 src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php
| <?php | <?php | ||||
| abstract class PhabricatorXHPASTViewPanelController | abstract class PhabricatorXHPASTViewPanelController | ||||
| extends PhabricatorXHPASTViewController { | extends PhabricatorXHPASTViewController { | ||||
| private $id; | private $id; | ||||
| private $storageTree; | private $storageTree; | ||||
| public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| public function willProcessRequest(array $data) { | public function willProcessRequest(array $data) { | ||||
| $this->id = $data['id']; | $this->id = $data['id']; | ||||
| $this->storageTree = id(new PhabricatorXHPASTViewParseTree()) | $this->storageTree = id(new PhabricatorXHPASTViewParseTree()) | ||||
| ->load($this->id); | ->load($this->id); | ||||
| if (!$this->storageTree) { | if (!$this->storageTree) { | ||||
| throw new Exception(pht('No such AST!')); | throw new Exception(pht('No such AST!')); | ||||
| } | } | ||||
| } | } | ||||
| protected function getStorageTree() { | protected function getStorageTree() { | ||||
| return $this->storageTree; | return $this->storageTree; | ||||
| } | } | ||||
| Show All 35 Lines | |||||
| } | } | ||||
| </style>'. | </style>'. | ||||
| '</head>'. | '</head>'. | ||||
| '<body>%s</body>'. | '<body>%s</body>'. | ||||
| '</html>', | '</html>', | ||||
| $content); | $content); | ||||
| $response = new AphrontWebpageResponse(); | return id(new AphrontWebpageResponse()) | ||||
| $response->setFrameable(true); | ->setFrameable(true) | ||||
| $response->setContent($content); | ->setContent($content); | ||||
| return $response; | |||||
| } | } | ||||
| } | } | ||||