[wp-hackers] Plugin dependency checking
Mike Schinkel
mikeschinkel at newclarity.net
Thu Jun 11 22:40:43 GMT 2009
Is there any reason why WordPress doesn't/we couldn't (shouldn't?) keep an array of plugin directories keys by plugin name (from WordPress.org's URL slug) and then have a function to retrieve the directory by name/slug? Non-hosted plugins could expose a name but not be guaranteed they are unique. This would provide the ability to have a function(s) like:
get_plugin_info($name)
get_plugin_dir($name)
I'm assuming WordPress has to scan the plugins directory at some point so why not save it for convenience of coding and to have a canonical method for determining info about a plugin?
-Mike Schinkel
Custom Wordpress Plugins
http://mikeschinkel.com/custom-wordpress-plugins
----- Original Message -----
From: "Burt Adsit" <burt at ourcommoninterest.org>
To: wp-hackers at lists.automattic.com
Sent: Thursday, June 11, 2009 11:03:42 AM GMT -05:00 US/Canada Eastern
Subject: Re: [wp-hackers] Plugin dependency checking
Well, ya but there's a catch 22 there. Without having bp loaded I can't
check for the bp plugin dir const. The plugin has to tell me those
things. If it's loaded I don't have to, if it isn't I can't. :)
scribu wrote:
> Btw, I noticed you have to hardcode 'buddypress/bp-loader.php'.
>
> It's a ((minor) problem because if either the buddypress folder is renamed
> or bp-loader.php is replaced with something else, the dependant plugin will
> break.
>
>
--
Code Is Freedom
Burt Adsit
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list