Question on plugin dependencies

Discussion corner for Developers of Serendipity.
Post Reply
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Question on plugin dependencies

Post by garvinhicking »

Hi!
RobA wrote:Is there anyway top make plugins dependent on each other?
Yes. Set a $this->dependencies array within the introspect() method of a plugin. Search through existing plugins for that keyword, you'll fine ones like staticpage or templatechooser :)

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, plugins listed in the dependency will be activated. I'm not sure if it would use Spartacus to download the plugins though (because that would possible create large dependency sets and many downloads)...

I'm not exactly sure if a plugin would complain if a dependency is not available, though. :(

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Via PHP you can check "if (class_exists('serendipity_event_geotag'))" for example?

We should check how the current plugin API manages unmet dependencies. IIRC I did implement a failsafe so that a pluginw ould not be loaded, but I'm lacking the time to check how it's currently handled :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply