Uploading Specific Vendor files with Laravel's Envoyer

本小妞迷上赌 提交于 2019-12-06 23:22:25

问题


I'm trying to upload only specific vendor files to my server using Laravel Forge. The reason is because I've edited the code in some of my dependencies, whats happening now is that certain features of my site are breaking because when I push from Envoyer to my server , Envoyer is grabbing from my GitHub repo.

my GitHub repo doesn't contain a vendor directory, as it shouldn't because Iv'e added that directory to my gitignore file

/vendor/*
/node_modules
Homestead.yaml
Homestead.json
.env

I've tried white listing certain folders within the directory like so:

/vendor/*
/node_modules
Homestead.yaml
Homestead.json
.env
!/vendor
!/vendor/misd

But then after I deploy from Envoyer to my server, My site stops working and I get an error message

Warning: require(/home/forge/default/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/forge/default/bootstrap/autoload.php on line 17

I've tried including the autoload.php file in the white list, but still get a similar message after deploying

How can I upload my versions of dependencies (the dependencies I edited). Whats happening now is that Envoyer is grabbing all the dependencies via composer, thus grabbing from the dependencies repo, thats great but, I need to be able to install my own versions of some of those dependencies

any Ideas


回答1:


As mentioned in the comments on the question itself this is a pretty dangerous situation and you'd be much better served extending the package or forking it and then using that.

That being said it does look like you have a git issue: Based solely on the error you're getting the problem appears as if it's less that you aren't including the module files (have you actually checked that the module files are present?) and more that /home/forge/default/bootstrap/../vendor/autoload.php isn't present. Based on the .gitignore you provide this is correct (You ignore all files in vendor--/vendor/*--and only include back the directory itself--!/vendor--and the subdirectory/file misd--!/vendor/misd). You either need to include /vendor/autoload.php--!/vendor/autoload.php--or you need to generate it after the fact some how.



来源:https://stackoverflow.com/questions/42415546/uploading-specific-vendor-files-with-laravels-envoyer

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