]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - document code and fix single-arg bless()
authorDylan William Hardison <dylan@hardison.net>
Thu, 26 Oct 2017 21:28:41 +0000 (17:28 -0400)
committerDylan William Hardison <dylan@hardison.net>
Tue, 31 Oct 2017 14:06:41 +0000 (10:06 -0400)
Bugzilla/ModPerl/StartupFix.pm

index e6e0e5f43dd7439d54547933f6a191440cc680e8..bcc467e9f3400054d4f88ca7fb93b08b5d600cb9 100644 (file)
@@ -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);