diff --git a/.gitignore b/.gitignore index d176eb3a03..1389147b3b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ # Impact Font /resources/font/impact.ttf + +# User-accessible hook for adhoc debugging scripts +/support/debug.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index f9098d0322..fb189ffb9a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -831,6 +831,7 @@ phutil_register_library_map(array( 'PhabricatorDaemonLogListView' => 'applications/daemon/view/PhabricatorDaemonLogListView.php', 'PhabricatorDaemonLogViewController' => 'applications/daemon/controller/PhabricatorDaemonLogViewController.php', 'PhabricatorDaemonReference' => 'infrastructure/daemon/control/PhabricatorDaemonReference.php', + 'PhabricatorDebugController' => 'applications/system/PhabricatorDebugController.php', 'PhabricatorDefaultFileStorageEngineSelector' => 'applications/files/engineselector/PhabricatorDefaultFileStorageEngineSelector.php', 'PhabricatorDefaultSearchEngineSelector' => 'applications/search/selector/PhabricatorDefaultSearchEngineSelector.php', 'PhabricatorDeveloperConfigOptions' => 'applications/config/option/PhabricatorDeveloperConfigOptions.php', @@ -1307,7 +1308,7 @@ phutil_register_library_map(array( 'PhabricatorSortTableExample' => 'applications/uiexample/examples/PhabricatorSortTableExample.php', 'PhabricatorSourceCodeView' => 'view/layout/PhabricatorSourceCodeView.php', 'PhabricatorStandardPageView' => 'view/page/PhabricatorStandardPageView.php', - 'PhabricatorStatusController' => 'applications/status/PhabricatorStatusController.php', + 'PhabricatorStatusController' => 'applications/system/PhabricatorStatusController.php', 'PhabricatorStorageFixtureScopeGuard' => 'infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php', 'PhabricatorStorageManagementAPI' => 'infrastructure/storage/management/PhabricatorStorageManagementAPI.php', 'PhabricatorStorageManagementDatabasesWorkflow' => 'infrastructure/storage/management/workflow/PhabricatorStorageManagementDatabasesWorkflow.php', @@ -2337,6 +2338,7 @@ phutil_register_library_map(array( 'PhabricatorDaemonLogListController' => 'PhabricatorDaemonController', 'PhabricatorDaemonLogListView' => 'AphrontView', 'PhabricatorDaemonLogViewController' => 'PhabricatorDaemonController', + 'PhabricatorDebugController' => 'PhabricatorController', 'PhabricatorDefaultFileStorageEngineSelector' => 'PhabricatorFileStorageEngineSelector', 'PhabricatorDefaultSearchEngineSelector' => 'PhabricatorSearchEngineSelector', 'PhabricatorDeveloperConfigOptions' => 'PhabricatorApplicationConfigOptions', diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php index df85f35030..2b905038dd 100644 --- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php @@ -109,6 +109,8 @@ class AphrontDefaultApplicationConfiguration 'testpaymentform/' => 'PhortuneStripeTestPaymentFormController', ), ), + + '/debug/' => 'PhabricatorDebugController', ); } diff --git a/src/applications/system/PhabricatorDebugController.php b/src/applications/system/PhabricatorDebugController.php new file mode 100644 index 0000000000..e26dd0e6c9 --- /dev/null +++ b/src/applications/system/PhabricatorDebugController.php @@ -0,0 +1,39 @@ +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(hsprintf('
%s', $out)); + return $response; + } + + private function getDebugFilePath() { + $root = dirname(phutil_get_library_root('phabricator')); + return $root.'/support/debug.php'; + } +} diff --git a/src/applications/status/PhabricatorStatusController.php b/src/applications/system/PhabricatorStatusController.php similarity index 100% rename from src/applications/status/PhabricatorStatusController.php rename to src/applications/system/PhabricatorStatusController.php