Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2893385
PhabricatorDebugController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorDebugController.php
View Options
<?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'
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 18:18 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127365
Default Alt Text
PhabricatorDebugController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment