]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1350467 - Add method Bugzilla->preload_features() to be called in mod_perl.pl...
authorDylan William Hardison <dylan@hardison.net>
Sun, 26 Mar 2017 03:13:07 +0000 (23:13 -0400)
committerDylan William Hardison <dylan@hardison.net>
Mon, 27 Mar 2017 16:43:16 +0000 (09:43 -0700)
Bugzilla/CPAN.pm
mod_perl.pl

index f044e45bcf6b8aed727c2bde5d76d8e2bd5941d9..1ffac601cbfc22afd74c1db23dbad7b11c0993ef 100644 (file)
@@ -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.
index bbca30c2e3074ae307cb8ca6bfd9749e5fd80c02..920032fe7059ca4cc9c8d8c7dce4b3190099b72a 100644 (file)
@@ -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