Jump to content

Move Composer's vendor folder outside of the web root folder


gmclelland
 Share

Recommended Posts

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

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

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

  • 4 months later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...