MediaWiki
master
opensearch_desc.php
Go to the documentation of this file.
1
<?php
15
use
MediaWiki\Context\RequestContext
;
16
17
// This endpoint is supposed to be independent of request cookies and other
18
// details of the session. Enforce this constraint with respect to session use.
19
define(
'MW_NO_SESSION'
, 1 );
20
21
define(
'MW_ENTRY_POINT'
,
'opensearch_desc'
);
22
23
require_once __DIR__ .
'/includes/WebStart.php'
;
24
25
$url
=
wfScript
(
'rest'
) .
'/v1/search'
;
26
$request
= RequestContext::getMain()->getRequest();
27
$ctype
=
$request
->getRawVal(
'ctype'
);
28
29
if
(
$ctype
!==
null
) {
30
$url
=
wfAppendQuery
(
$url
, [
'ctype'
=>
$ctype
] );
31
}
32
33
$request
->response()->header(
'Location: '
.
$url
,
true
, 308 );
34
$request
->response()->header(
'Cache-control: max-age=600'
);
wfAppendQuery
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
Definition
GlobalFunctions.php:333
wfScript
wfScript( $script='index')
Get the URL path to a MediaWiki entry point.
Definition
GlobalFunctions.php:1536
MediaWiki\Context\RequestContext
Group all the pieces relevant to the context of a request into one instance.
Definition
RequestContext.php:50
$ctype
$ctype
Definition
opensearch_desc.php:27
$request
$request
Definition
opensearch_desc.php:26
$url
$url
Definition
opensearch_desc.php:25
opensearch_desc.php
Generated on Mon Oct 5 2026 18:28:17 for MediaWiki by
1.10.0