Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Installing non-silverstripe plugins using Composer


Go to End


3 Posts   565 Views

Avatar
martimiz

Forum Moderator, 1391 Posts

18 November 2014 at 1:49am

I added a requirement for a non-silverstripe (jQuery) plugin to my (root) composer.json file. So SilverStripe automatically installs it in the /vendor directory. Unfortunately then loading any .js files will generate a 403 due to this line in .htaccess:

RewriteRule ^vendor(/|$) - [F,L,NC]

I could possibly add a composer requirement for a plugin that supports defining an installer path for individual packages, or maybe add an extra rewite rule to .htaccess for this specific package, but what would be the preferred Silvestripe way to do this? How is this supposed to work?

Avatar
camfindlay

Forum Moderator, 267 Posts

18 November 2014 at 4:26pm

There was a bit of discussion about this a number of months back (when we were trialling a new tool for decision making) - might be work a read over, it is at https://www.loomio.org/d/0siznDgv/how-should-we-manage-front-end-dependencies

Avatar
martimiz

Forum Moderator, 1391 Posts

19 November 2014 at 6:17am

Thanks Cam, reading that I guess it's is a complex matter after all.

Just to be complete: updating from a composer file in mysite or another module does create a vendor folder in that module, that is accessible. I was amazed, though, at the amount of files a simple jQuery requirement for a jQuery plugin package got me, where I really ever only wanted the one plugin file... :)