]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1283612 - Add Bugzilla::Extension module loader last 7/head
authorDylan William Hardison <dylan@hardison.net>
Thu, 30 Jun 2016 17:47:15 +0000 (13:47 -0400)
committerDylan William Hardison <dylan@hardison.net>
Thu, 30 Jun 2016 20:49:31 +0000 (16:49 -0400)
Currently, anything that is loaded after the bugzilla extensions
are loaded has to search through each callback inserted into @INC
by Bugzilla::Extension. If you have a lot of extensions this is slow.

It is harmless to search for Bugzilla::Extension::* modules last, so
we replace the unshift with a push.

Bugzilla/Extension.pm

index fcd41ae8684a7a9f9e063c9171bd8e251e31220f..eb17b9f1a71f4f3b7f277e408cfccd6445497968 100644 (file)
@@ -143,7 +143,7 @@ sub modify_inc {
     # directory. We don't want Bugzilla's base lib/CGI.pm being loaded as 
     # Bugzilla::Extension::Foo::CGI or any other confusing thing like that.
     return if $package_dir eq bz_locations->{'extensionsdir'};
-    unshift(@INC, sub { __do_call($class, 'my_inc', @_) });
+    push(@INC, sub { __do_call($class, 'my_inc', @_) });
 }
 
 # This is what gets put into @INC by modify_inc.