Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F33867
RedirectException.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
889 B
Referenced Files
None
Subscribers
None
RedirectException.php
View Options
<?php
namespace
MediaWiki\Rest
;
/**
* This is an exception class that extends HttpException and will
* generate a redirect when handled. It is used when a redirect is
* treated as an exception output in your API, and you want to be able
* to throw it from wherever you are and immediately halt request
* processing.
*
* @newable
* @since 1.36
*/
class
RedirectException
extends
HttpException
{
/**
* The redirect target (an absolute URL)
* @var string
*/
private
$target
;
/**
* @stable to call
*
* @param int $code The HTTP status code (3xx) for this redirect
* @param string $target The redirect target (an absolute URL)
*/
public
function
__construct
(
int
$code
,
string
$target
)
{
parent
::
__construct
(
'Redirect'
,
$code
);
$this
->
target
=
$target
;
}
/**
* @return string
*/
public
function
getTarget
():
string
{
return
$this
->
target
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Dec 19, 03:29 (1 d, 4 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1f/0c/a4041179257f339996454c3e266e
Default Alt Text
RedirectException.php (889 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment