@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class Aphront404Response extends AphrontHTMLResponse {
4
5 public function getHTTPResponseCode() {
6 return 404;
7 }
8
9 public function buildResponseString() {
10 $request = $this->getRequest();
11 $viewer = $request->getViewer();
12
13 // See T13636. Note that this response may be served from a Site other than
14 // the primary PlatformSite. For now, always link to the PlatformSite.
15
16 // (This may not be the best possible place to send users who are currently
17 // on "real" sites, like the BlogSite.)
18 $return_uri = PhabricatorEnv::getURI('/');
19
20 $dialog = id(new AphrontDialogView())
21 ->setViewer($viewer)
22 ->setTitle(pht('404 Not Found'))
23 ->addCancelButton($return_uri, pht('Return to Charted Waters'))
24 ->appendParagraph(
25 pht(
26 'You arrive at your destination, but there is nothing here.'))
27 ->appendParagraph(
28 pht(
29 'Perhaps the real treasure was the friends you made '.
30 'along the way.'));
31
32 $view = id(new PhabricatorStandardPageView())
33 ->setTitle(pht('404 Not Found'))
34 ->setRequest($request)
35 ->setDeviceReady(true)
36 ->appendChild($dialog);
37
38 return $view->render();
39 }
40
41}