If you need a new hook for your extension and you want that hook to be added to Bugzilla itself, see our development process at. You can get that data via "input_params" in Bugzilla. The subroutine will be called as a method on your extension, and it will get the arguments specified in the hook's documentation as named parameters in a hashref.įor example, here's an implementation of a hook named foo_start that gets an argument named bar: sub foo_start Īnd that would go into your extension's code file-the file that was described in the "Where Extension Code Goes" section above.ĭuring your subroutine, you may want to know what values were passed as CGI arguments to the current script, or what arguments were passed to the current WebService method. If your extension wants to implement a hook, all you have to do is write a subroutine in your hook package that has the same name as the hook. These are the various areas of Bugzilla that an extension can "hook" into, which allow your extension to perform code during that point in Bugzilla's execution. In Bugzilla::Hook, there is a list of hooks. The name must be identical in all of those locations. You'll notice that though most Perl packages end with 1, Bugzilla Extensions must always end with _PACKAGE_->NAME.
0 Comments
Leave a Reply. |