gitweb: Precompile CGI routines for mod_perl

Following advice from CGI(3pm) man page, precompile all CGI routines
for mod_perl, in the BEGIN block.

  If you want to compile without importing use the compile() method
  instead:

    use CGI();
    CGI->compile();

  This is particularly useful in a mod_perl environment, in which you
  might want to precompile all CGI routines in a startup script, and then
  import the functions individually in each mod_perl script.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Jakub Narebski 2006-12-28 00:00:52 +01:00 коммит произвёл Junio C Hamano
Родитель 45c9a7583c
Коммит b1f5f64fc8
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -18,6 +18,10 @@ use File::Find qw();
use File::Basename qw(basename);
binmode STDOUT, ':utf8';
BEGIN {
CGI->compile() if $ENV{MOD_PERL};
}
our $cgi = new CGI;
our $version = "++GIT_VERSION++";
our $my_url = $cgi->url();