Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894962
AphrontRedirectResponse.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
AphrontRedirectResponse.php
View Options
<?php
/**
* TODO: Should be final but isn't because of AphrontReloadResponse.
*
* @group aphront
*/
class
AphrontRedirectResponse
extends
AphrontResponse
{
private
$uri
;
public
function
setURI
(
$uri
)
{
$this
->
uri
=
$uri
;
return
$this
;
}
public
function
getURI
(
)
{
return
(string)
$this
->
uri
;
}
public
function
shouldStopForDebugging
(
)
{
return
PhabricatorEnv
::
getEnvConfig
(
'debug.stop-on-redirect'
)
;
}
public
function
getHeaders
(
)
{
$headers
=
array
(
)
;
if
(
!
$this
->
shouldStopForDebugging
(
)
)
{
$headers
[
]
=
array
(
'Location'
,
$this
->
uri
)
;
}
$headers
=
array_merge
(
parent
::
getHeaders
(
)
,
$headers
)
;
return
$headers
;
}
public
function
buildResponseString
(
)
{
if
(
$this
->
shouldStopForDebugging
(
)
)
{
$view
=
new
PhabricatorStandardPageView
(
)
;
$view
->
setRequest
(
$this
->
getRequest
(
)
)
;
$view
->
setApplicationName
(
'Debug'
)
;
$view
->
setTitle
(
'Stopped on Redirect'
)
;
$error
=
new
AphrontErrorView
(
)
;
$error
->
setSeverity
(
AphrontErrorView
::
SEVERITY_NOTICE
)
;
$error
->
setTitle
(
'Stopped on Redirect'
)
;
$error
->
appendChild
(
phutil_tag
(
'p'
,
array
(
)
,
pht
(
'You were stopped here because %s is set in your configuration.'
,
phutil_tag
(
'tt'
,
array
(
)
,
'debug.stop-on-redirect'
)
)
)
)
;
$link
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$this
->
getURI
(
)
,
)
,
$this
->
getURI
(
)
)
;
$error
->
appendChild
(
phutil_tag
(
'p'
,
array
(
)
,
pht
(
'Continue to: %s'
,
$link
)
)
)
;
$view
->
appendChild
(
$error
)
;
return
$view
->
render
(
)
;
}
return
''
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 20:45 (6 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128573
Default Alt Text
AphrontRedirectResponse.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment