Extensions and include paths

Bradley Baetz bbaetz at acm.org
Mon Apr 14 22:06:02 UTC 2008


Hi,

Extensions and include paths seem a bit confused. Firstly, theres the
template path. For a hook, the template needs to be in a file called
extensions/<name>/template/en/global/code-error-<hookname>.html.tmpl..
But any templates in an extension that want to be in the 'standard'
template include path go under
extensions/<name>/template/en/{default,custom}/<path>/foo.html.tmpl.
However, if its a hook thats not part of an extension, the template
needs to be a file in the directory
template/custom/hook/global/code-error.html.tmpl/<hookname>/

Plus, the extensions are added to the template include path even if
they're disabled, and they're not precompiled.

https://bugzilla.mozilla.org/show_bug.cgi?id=428607

Then theres the library path. When calling a hook from an extension,
extensions/<name>/lib is temporarily added to the library path.
However, some of the hooks (eg webservices) pass back a string for a
perl module that is later dynamically required at run time, when that
directory isn't part of the libpath, so the module's name actually has
to be relative to the top level directory, ie
lib::extensions::Example::lib::Foo in those cases. And if the
extension has any supporting modules, they have to be done the same
way to be used by the webservices module. Which is a bit confusing as
well...

(No bug for that yet)

Also, whats the reason behind the code hooks being a bunch of .pl
files rather than a standard perl module with a sub per hook?

This is all a bit confusing.... Thoughts?

Bradley



More information about the developers mailing list