@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
3abstract class PhabricatorRobotsController extends PhabricatorController {
4
5 public function shouldRequireLogin() {
6 return false;
7 }
8
9 final public function processRequest() {
10 $out = $this->newRobotsRules();
11
12 $content = implode("\n", $out)."\n";
13
14 return id(new AphrontPlainTextResponse())
15 ->setContent($content)
16 ->setCacheDurationInSeconds(phutil_units('2 hours in seconds'))
17 ->setCanCDN(true);
18 }
19
20 abstract protected function newRobotsRules();
21
22}