gmclelland Posted May 8, 2018 Share Posted May 8, 2018 I was just wondering if it is possible in Processwire to move Composer's vendor directory outside of the web root folder to a location that is not web accessible? Is there a configuration variable to control this? I couldn't find information in my searches. Why would I want to do this? ...for security. I don't want script kiddies trying to scan for/exploit vulnerabilities in my installed php libraries. Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted May 8, 2018 Share Posted May 8, 2018 Hey, @gmclelland Seems like you can't change the composer autoloader location in ProcessWire. But maybe there are ways to configure composer itself to store packages elsewhere? A quick search gave me this. Not sure it can help though) Link to comment Share on other sites More sharing options...
gmclelland Posted May 8, 2018 Author Share Posted May 8, 2018 Many thanks Ivan. I'll open a github issue for this. Link to comment Share on other sites More sharing options...
gmclelland Posted May 8, 2018 Author Share Posted May 8, 2018 https://github.com/processwire/processwire-requests/issues/191 1 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted May 8, 2018 Share Posted May 8, 2018 I tried to instruct composer running from PW root to put vendor one level up in the folder tree with vendor-dir setting. It seems not to work (at least with the relative path I provided). Did you manage to solve this, @gmclelland? Or are you moving the vendor folder manually? If so, maybe a simple require_once('../../vendor/autoload.php'); in site/init.php can help? Link to comment Share on other sites More sharing options...
gmclelland Posted May 8, 2018 Author Share Posted May 8, 2018 No, I haven't solved this, but I did open a new request for it in the github link above. Let's see what Ryan has to say. Quote require_once('../../vendor/autoload.php'); That would probably work, but I think this should be configurable via Processwire. Link to comment Share on other sites More sharing options...
elabx Posted September 26, 2018 Share Posted September 26, 2018 Hi! Has anyone found a solutions for this? I have several sites that use the same composer modules i'd love if I could just install them globally for the user. Though suspecting from where the require_once happens, I feel my only choice would be using symlinks? Just made a comment also in the GitHub issue. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now