Composer - Mapping the src directory to the document root with the vendor folder outside

蓝咒 提交于 2020-01-03 03:28:30

问题


I have the following folder structure.

src/
  |- index.php
test/
vendor/
composer.json
composer.lock

When i want to deploy my code, I realize that i have to map the src/ directory to document root since it contains the index.php file (which btw contains some Restler code) However, if i do that, how do i deal with the vendor/ folder that lies outside the document root?


回答1:


vendor folder MUST be outside of the web root for better security

When you include autoload.php or restler.php, it will take care of making those classes (residing in vendor folder) available

Ideally you should keep your index.php in a folder named public and use src folder for keeping your own code



来源:https://stackoverflow.com/questions/24040544/composer-mapping-the-src-directory-to-the-document-root-with-the-vendor-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!