[wp-hackers] Class conflicts with plugin frameworks

Dion Hulse (dd32) wordpress at dd32.id.au
Thu Apr 28 02:15:33 UTC 2011


..Wow i re-read that and see i spent Globals wrong :) - That was
psuedo-written php, I would never not quote a string like that!
I've used a similar functionality to what i wrote below in the past, As long
as the frameworks are back-compatible (ie. those written for version 28 are
compatible with 31) you have no problem. The hardest part is keeping the
framaework up to date in the plugins you're releasing (a svn:external is
ideal for this, unfortunately (for security & code archival reasons i guess)
this isn't possible on WordPress.org hosted plugins)

On 28 April 2011 12:06, John Blackbourn <johnbillion+wp at gmail.com> wrote:

> On 28 April 2011 03:00, Dion Hulse (dd32) <wordpress at dd32.id.au> wrote:
> > The best way is to just do a
> > if ( ! class_exists('myclass') ) include framework.php.
> >
> > of course, if you only want to include the latest version, i'd do
> something
> > such as :(ie. this copy of hte plugin includes version 31 of the
> framework)
> > in global scope upon plugin inclusion:
> > $GLOALS[mvcversion] = max (   $GLOALS[mvcversion], 31 )
> > add_action plugins_loaded:
> >    if ( 31 ==   $GLOALS[mvcversion] &&  ! class_exists('myclass')  )
> //This
> > plugin has the latest version, and it's not already included
> >         include framework.php.
>
> That is a pretty nifty method right there. Consider it borrowed. Thanks
> Dion.
> _______________________________________________
> 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