From: Dylan William Hardison Date: Sun, 26 Mar 2017 03:13:07 +0000 (-0400) Subject: Bug 1350467 - Add method Bugzilla->preload_features() to be called in mod_perl.pl... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc6eca0cc8ab4dd41a5b5f618fa8e49b0fe194f7;p=thirdparty%2Fbugzilla.git Bug 1350467 - Add method Bugzilla->preload_features() to be called in mod_perl.pl startup --- diff --git a/Bugzilla/CPAN.pm b/Bugzilla/CPAN.pm index f044e45bc..1ffac601c 100644 --- a/Bugzilla/CPAN.pm +++ b/Bugzilla/CPAN.pm @@ -104,6 +104,16 @@ sub feature { return $FEATURE_LOADED{$feature_name} = 1; } +sub preload_features { + my ($class) = @_; + return 0 unless _CAN_HAS_FEATURE; + my $meta = $class->cpan_meta; + + foreach my $feature ($meta->features) { + $class->feature($feature->identifier); + } +} + 1; __END__ @@ -140,3 +150,6 @@ are installed. Returns a L from the contents of MYMETA.json in the bugzilla directory. +=head2 C + +Attempts to load all features. diff --git a/mod_perl.pl b/mod_perl.pl index bbca30c2e..920032fe7 100644 --- a/mod_perl.pl +++ b/mod_perl.pl @@ -93,6 +93,8 @@ $server->add_config([split("\n", $conf)]); # Pre-load all extensions $Bugzilla::extension_packages = Bugzilla::Extension->load_all(); +Bugzilla->preload_features(); + # Have ModPerl::RegistryLoader pre-compile all CGI scripts. my $rl = new ModPerl::RegistryLoader(); # If we try to do this in "new" it fails because it looks for a