[wp-hackers] plugin loading order (rfc)
Peter Westwood
peter.westwood at ftwr.co.uk
Sun Mar 11 22:16:36 GMT 2007
Computer Guru wrote:
> Won't a simple require_once() command take care of it?
>
> Say plugins X and B require plugin M.
>
> Plugin B loads. First line of code has a require_once for a known plugin M
> require_once("m.php");
> It's not loaded yet, so it gets loaded as a part of this routine.
>
> Plugin X loads. It needs plugin M, which is already loaded.
> require_once("m.php");
> It's already loaded, nothing happens.
>
> The only requirement is that you know the path to plugin M. But even if you
> had a dependency system, you'd still have to know something about plugin M
> to require it anyway.
>
This breaks outside of the activate/deactivate paradigm for plugins
though doesn't it - as I would never be able to deactivate plugin m as
plugin x or b would load it anyway.
westi
--
Peter Westwood
http://blog.ftwr.co.uk
More information about the wp-hackers
mailing list