diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-10-26 23:28:41 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-10-31 15:06:41 +0100 |
commit | 7d35b918dba36abb75e4a8d41455b9ded3032969 (patch) | |
tree | c5829a64b439d5117b793f5a2d6a395899d71dbd /Bugzilla | |
parent | f290cbf7d093bab857111994514fdd5d5c60c41b (diff) | |
download | bugzilla-7d35b918dba36abb75e4a8d41455b9ded3032969.tar.gz bugzilla-7d35b918dba36abb75e4a8d41455b9ded3032969.tar.xz |
no bug - document code and fix single-arg bless()
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/ModPerl/StartupFix.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Bugzilla/ModPerl/StartupFix.pm b/Bugzilla/ModPerl/StartupFix.pm index e6e0e5f43..bcc467e9f 100644 --- a/Bugzilla/ModPerl/StartupFix.pm +++ b/Bugzilla/ModPerl/StartupFix.pm @@ -12,17 +12,25 @@ use warnings; use Filter::Util::Call; use Apache2::ServerUtil (); +# This module is a source filter that removes every subsequent line +# if this is the first time apache has started, +# as reported by Apache2::ServerUtil::restart_count(), which is 1 +# on the first start. + my $FIRST_STARTUP = <<'CODE'; warn "Bugzilla::ModPerl::StartupFix: Skipping first startup using source filter\n"; 1; CODE sub import { - my ($type) = @_; + my ($class) = @_; my ($ref) = {}; - filter_add( bless $ref ); + filter_add( bless $ref, $class ); } +# this will be called for each line. +# For the first line replaced, we insert $FIRST_STARTUP. +# Every subsequent line is replaced with an empty string. sub filter { my ($self) = @_; my ($status); |