25define(
'MW_NO_SESSION', 1 );
27define(
'MW_ENTRY_POINT',
'opensearch_desc' );
29require_once __DIR__ .
'/includes/WebStart.php';
31if (
$wgRequest->getVal(
'ctype' ) ==
'application/xml' ) {
33 $ctype =
'application/xml';
35 $ctype =
'application/opensearchdescription+xml';
39$response->header(
"Content-type: $ctype" );
45$response->header(
'Cache-control: max-age=600' );
48print Xml::openElement(
'OpenSearchDescription',
50 'xmlns' =>
'http://a9.com/-/spec/opensearch/1.1/',
51 'xmlns:moz' =>
'http://www.mozilla.org/2006/browser/search/' ] );
69print Xml::element(
'Image',
73 'type' =>
'image/x-icon' ],
83 'type' =>
'text/html',
85 'template' =>
$searchPage->getCanonicalURL(
'search={searchTerms}' ) ];
96 'template' => $template,
105foreach (
$urls as $attribs ) {
116print '</OpenSearchDescription>';
$wgOpenSearchTemplates
Templates for OpenSearch suggestions, defaults to API action=opensearch.
$wgFavicon
The URL path of the shortcut icon.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
if(! $wgDBerrorLogTZ) $wgRequest
static getOpenSearchTemplate( $type)
Fetch the template for a type.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.