(cc'ing the mailing list as this is an interesting topic for all plugin developers)
I suggest to specify the dependencies in your plugin's composer.json file which is used to register it in our new plugins repository at http://plugins.roundcube.net.
If the external libraries are also available as composer packages, like phpseclib, just add them to the "require" section of your composer.json file and you're done. When installing Roundcube plugins through composer, all the dependencies are downloaded and installed to vendor/xxx. Roundcube also includes composer's autoloader and therefore all classes from the external libraries are automatically available to your plugin without having to require or include anything.
I hope this helps.
Kind regards, Thomas
On Tue, May 13, 2014 at 5:55 PM, Pi m pimlie@hotmail.com wrote:
Hi all,
What is the prefered/ best way to link to external libraries in my roundcube plugin (authres_status)? Do you have an opinion about that?
For my plugin I would like to link to two other github projects, one is also available through composer. For now I have added them as submodules to my github project (not yet pushed to remote), but especially phpseclib (https://github.com/phpseclib/phpseclib) could maybe also be interesting for other plugins. Is there a common place to put those libraries in or should I just create a bloated plugin that includes all those files?
Thanks!
Kind Rgds, Pim (aka pimlie)
On 15 May 2014, at 08:44, Thomas Bruederli thomas@roundcube.net wrote:
(cc'ing the mailing list as this is an interesting topic for all plugin developers)
I suggest to specify the dependencies in your plugin's composer.json file which is used to register it in our new plugins repository at http://plugins.roundcube.net.
If the external libraries are also available as composer packages, like phpseclib, just add them to the "require" section of your composer.json file and you're done. When installing Roundcube plugins through composer, all the dependencies are downloaded and installed to vendor/xxx. Roundcube also includes composer's autoloader and therefore all classes from the external libraries are automatically available to your plugin without having to require or include anything.
I hope this helps.
Wont this create vendor conflicts?
A quick test seems to suggest that if 1 plugin requires say version 1.*, and another version 2.* this wont work. Looks like only 1 of the 2 gets installed.
Cor
On Thu, May 15, 2014 at 9:12 AM, Cor Bosman cor@xs4all.nl wrote:
On 15 May 2014, at 08:44, Thomas Bruederli thomas@roundcube.net wrote:
(cc'ing the mailing list as this is an interesting topic for all plugin developers)
I suggest to specify the dependencies in your plugin's composer.json file which is used to register it in our new plugins repository at http://plugins.roundcube.net.
If the external libraries are also available as composer packages, like phpseclib, just add them to the "require" section of your composer.json file and you're done. When installing Roundcube plugins through composer, all the dependencies are downloaded and installed to vendor/xxx. Roundcube also includes composer's autoloader and therefore all classes from the external libraries are automatically available to your plugin without having to require or include anything.
I hope this helps.
Wont this create vendor conflicts?
A quick test seems to suggest that if 1 plugin requires say version 1.*, and another version 2.* this wont work. Looks like only 1 of the 2 gets installed.
That seems to be true but also would be the base with PEAR et al. If your plugin for some reason cannot work with the latest version available through composer, you can still put a vendorized copy into your plugin folder and do the (auto)loading yourself.
We didn't want to get all into packages and dependency management and thus chose an existing solution. And as all existing package managers have some issues, we/you have to deal with them as they hit us/you.
~Thomas
I suggest to specify the dependencies in your plugin's composer.json file which is used to register it in our new plugins repository at http://plugins.roundcube.net.
I think http://trac.roundcube.net/ticket/1489785 is related. Composer appears to be not great and checking what is already available on the system.
I'm not sure the description in this ticket is 100% correct. I cannot recreate it. I am wondering if may be its when people have PEAR globally available on their system – Composer can’t tell, adds it and then the two conflict.
I know that both the PEAR class and Net_Sieve are shipped with Roundcube but I thought it was best to include the dependencies for people who have the GPL version installed. May be that was a mistake and I should not include it at all, just put a comment in the readme for people who need it.
Also because Roundcube its self does not use Composer it's not possible to add in "standard" plugins that are required - like jqueryui for example.
Phil