summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jakub Narebski <jnareb@gmail.com>2006-12-28 00:00:52 +0100
committerLibravatar Junio C Hamano <junkio@cox.net>2006-12-28 00:57:31 -0800
commitb1f5f64fc831eb9f90bd07dc708279a921410bb2 (patch)
tree3c54a00639ef470460af80c495c7894b36c0d383
parentgitweb: Add mod_perl version string to "generator" meta header (diff)
downloadtgif-b1f5f64fc831eb9f90bd07dc708279a921410bb2.tar.xz
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>
-rwxr-xr-xgitweb/gitweb.perl4
1 files changed, 4 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a0a614acaf..d845e91e20 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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();