2017-03-21 16:27:49 +00:00
|
|
|
#!/usr/bin/perl -T
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2009-07-03 02:13:41 +00:00
|
|
|
#
|
2017-03-21 16:27:49 +00:00
|
|
|
# This Source Code Form is "Incompatible With Secondary Licenses", as
|
|
|
|
# defined by the Mozilla Public License, v. 2.0.
|
2009-07-03 02:13:41 +00:00
|
|
|
|
2017-03-21 16:27:49 +00:00
|
|
|
use 5.10.1;
|
2009-07-03 02:13:41 +00:00
|
|
|
use strict;
|
2017-03-21 16:27:49 +00:00
|
|
|
use warnings;
|
|
|
|
|
2009-07-03 02:14:25 +00:00
|
|
|
use lib qw(. lib);
|
2009-07-03 02:13:41 +00:00
|
|
|
|
|
|
|
use Bugzilla;
|
|
|
|
use Bugzilla::Error;
|
2014-10-16 16:00:58 +00:00
|
|
|
use Bugzilla::Constants;
|
2009-07-03 02:13:41 +00:00
|
|
|
|
|
|
|
Bugzilla->login();
|
|
|
|
|
|
|
|
my $cgi = Bugzilla->cgi;
|
|
|
|
my $template = Bugzilla->template;
|
2014-10-16 16:00:58 +00:00
|
|
|
my $vars = {};
|
2009-07-03 02:13:41 +00:00
|
|
|
|
|
|
|
# Return the appropriate HTTP response headers.
|
|
|
|
print $cgi->header('application/xml');
|
|
|
|
|
2014-10-16 16:00:58 +00:00
|
|
|
# Get the contents of favicon.ico
|
|
|
|
my $filename = bz_locations()->{'libpath'} . "/images/favicon.ico";
|
2017-03-21 16:27:49 +00:00
|
|
|
if (open(IN, '<', $filename)) {
|
2014-10-16 16:00:58 +00:00
|
|
|
local $/;
|
|
|
|
binmode IN;
|
|
|
|
$vars->{'favicon'} = <IN>;
|
|
|
|
close IN;
|
|
|
|
}
|
|
|
|
$template->process("search/search-plugin.xml.tmpl", $vars)
|
2009-07-03 02:13:41 +00:00
|
|
|
|| ThrowTemplateError($template->error());
|