Something went wrong. Try again.
@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
Something went wrong. Try again.
1.0 kB · 39 lines
PHP
12345678910111213141516171819202122232425262728293031323334353637383940<?php
/** * This controller eases debugging of application problems that don't repro * locally by allowing installs to add arbitrary debugging code easily. To use * it: * * - Write some diagnostic script. * - Instruct the user to install it in `/support/debug.php`. * - Tell them to visit `/debug/`. */final class PhabricatorDebugController extends PhabricatorController {
public function shouldRequireLogin() { return false; }
public function processRequest() { if (!Filesystem::pathExists($this->getDebugFilePath())) { return new Aphront404Response(); }
$request = $this->getRequest(); $user = $request->getUser();
ob_start(); require_once $this->getDebugFilePath(); $out = ob_get_clean();
$response = new AphrontWebpageResponse(); $response->setContent(phutil_tag('pre', array(), $out)); return $response; }
private function getDebugFilePath() { $root = dirname(phutil_get_library_root('phabricator')); return $root.'/support/debug.php'; }}