You need to sign in or sign up before continuing.
search_plugin.cgi 960 Bytes
Newer Older
1
#!/usr/bin/perl -T
2 3 4
# 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/.
5
#
6 7
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
8

9
use 5.10.1;
10
use strict;
11 12
use warnings;

13
use lib qw(. lib);
14 15

use Bugzilla;
16
use Bugzilla::Error;
17
use Bugzilla::Constants;
18 19 20

Bugzilla->login();

21
my $cgi      = Bugzilla->cgi;
22
my $template = Bugzilla->template;
23
my $vars     = {};
24 25 26 27

# Return the appropriate HTTP response headers.
print $cgi->header('application/xml');

28 29
# Get the contents of favicon.ico
my $filename = bz_locations()->{'libpath'} . "/images/favicon.ico";
30
if (open(IN, '<', $filename)) {
31 32 33 34
  local $/;
  binmode IN;
  $vars->{'favicon'} = <IN>;
  close IN;
35 36
}
$template->process("search/search-plugin.xml.tmpl", $vars)
37
  || ThrowTemplateError($template->error());