Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Best practice for plugin dependencies

Solved by Ole Vik View solution

Started by Richard Hainsworth 8 years ago · 3 replies · 849 views
8 years ago

I've written several plugins for shortcodes. All of them obviously depend on shortcode-core.

However, when testing code I try to install the minimum number of plugins, and I forget to install shortcode-code.

What is the best practice for ensuring that a plugin which depends on another plugin installs the dependency first?

I have searched using 'grav dependencies' and come across references to the file .dependencies but there does not seem to be any easily available description about what .dependencies should contain.

In addition, there is a post saying that .dependencies is a hold-over from a previous development system, and that indicates it is not the best way forward.

8 years ago Solution

In my opinion, always use the dependencies in the plugin's blueprints, and use them exhaustively.

This will ensure that GPM installs the dependencies only if they resolve with the current Grav-environment.

8 years ago

I looked up google-maps, a plugin I've used that I know depends shortcode core, and saw that it uses the plugin blueprint as per Ole's comment.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 49 1 week ago
Plugins · by Xavier, 4 weeks ago
2 57 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1184 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 75 2 months ago