Path: blob/master/src/applications/files/controller/PhabricatorFileDocumentController.php
12242 views
<?php12final class PhabricatorFileDocumentController3extends PhabricatorFileController {45public function shouldAllowPublic() {6return true;7}89public function handleRequest(AphrontRequest $request) {10$engine = id(new PhabricatorFileDocumentRenderingEngine())11->setRequest($request)12->setController($this);1314$viewer = $request->getViewer();1516$file_phid = $request->getURIData('phid');1718$file = id(new PhabricatorFileQuery())19->setViewer($viewer)20->withPHIDs(array($file_phid))21->executeOne();22if (!$file) {23return $engine->newErrorResponse(24pht(25'This file ("%s") does not exist or could not be loaded.',26$file_phid));27}2829$ref = id(new PhabricatorDocumentRef())30->setFile($file);3132return $engine->newRenderResponse($ref);33}3435}363738