summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-03-26 05:13:07 +0200
committerDylan William Hardison <dylan@hardison.net>2017-03-27 18:43:16 +0200
commitdc6eca0cc8ab4dd41a5b5f618fa8e49b0fe194f7 (patch)
tree15b688b2c7c0a08ed5331ea2b1c84533357de9c4
parent15daaf123635c1e734dfe6e3aed60f52df0364ce (diff)
downloadbugzilla-dc6eca0cc8ab4dd41a5b5f618fa8e49b0fe194f7.tar.gz
bugzilla-dc6eca0cc8ab4dd41a5b5f618fa8e49b0fe194f7.tar.xz
Bug 1350467 - Add method Bugzilla->preload_features() to be called in mod_perl.pl startup
-rw-r--r--Bugzilla/CPAN.pm13
-rw-r--r--mod_perl.pl2
2 files changed, 15 insertions, 0 deletions
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<CPAN::Meta> from the contents of MYMETA.json in the bugzilla directory.
+=head2 C<preload_features()>
+
+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