4 * Generate an OpenSearch description file
7 require_once( dirname(__FILE__
) . '/includes/WebStart.php' );
8 $shortName = htmlspecialchars( mb_substr( $wgSitename, 0, 16 ) );
9 $siteName = htmlspecialchars( $wgSitename );
10 $favicon = htmlspecialchars( $wgFavicon );
11 $title = Title
::makeTitle( NS_SPECIAL
, 'Search' );
12 $template = $title->getFullURL( 'search={searchTerms}' );
14 $response = $wgRequest->response();
15 $response->header( 'Content-type: application/opensearchdescription+xml' );
17 # Set an Expires header so that squid can cache it for a short time
18 # Short enough so that the sysadmin barely notices when $wgSitename is changed
19 $expiryTime = 300; # 5 minutes
20 $response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() +
$expiryTime ) . ' GMT' );
24 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
25 <ShortName>$shortName</ShortName>
26 <Description>$siteName</Description>
27 <Image height="16" width="16" type="image/x-icon">$favicon</Image>
28 <Url type="text/html" method="get" template="$template"/>
29 </OpenSearchDescription>