要保存到存储库laravel的文件 - 框架工作流程

要保存到存储库laravel的文件 - 框架工作流程

问题描述:

Let me just say this, I'm very new to composer and laravel.

I'm a long time cli fan, so I feel very comfy with composer. I've used npm, ruby gems etc, I see all the benefits to package managers.

Problem is, I'm saving entire laravel dir to my svn repository. It seems kinda redundant, especially vendor/bootstrap dirs.

I also find it uncomfortable to have vendor packages same in every laravel app directory on the same server, I'm kinda missing global gems thing from ruby.

How do you deal with this? Is it possible to have laravel like a shared library on server and then just have app/public directories in each project?

What files should be saved to repository? can composer handle all the dependency installation on production server? I see laravel files come with .gitignore files, where do I get svn version?

Much confusion atm in my head, hope to clear these up, so I can start actually writing code ^_^

让我说一下,我对作曲家和laravel很新。 p>

我是一个很长时间的粉丝,所以我对作曲家感到非常舒服。 我使用过npm,ruby gems等,我看到了包管理器的所有好处。 p>

问题是,我将整个laravel目录保存到我的svn存储库中。 这似乎有点多余,特别是供应商/ bootstrap dirs。 p>

我也觉得在同一台服务器上的每个laravel应用程序目录中都有相同的供应商包很不舒服,我有点缺少全球宝石的东西 来自红宝石。 p>

你如何应对这个问题? 是否可以像服务器上的共享库一样使用laravel,然后在每个项目中只有app / public目录? p>

应该将哪些文件保存到存储库? composer可以处理生产服务器上的所有依赖项安装吗? 我看到laravel文件带有.gitignore文件,我在哪里获得svn版本? p>

我头脑中有很多困惑,希望能清除它们,所以我可以开始实际编写代码^ _ ^ p> div>

First off, as far as I know, it is not easily possible to install laravel and it's dependencies globally. I wouldn't worry about that too much though since composer will cache them so it won't need to download everything for each project you set up.

Vendor directory

The vendor dir should definitely NOT be in your repository. I'm no SVN expert but according to this answer you can ignore directories by doing:

svn propset svn:ignore "vendor" .

Most SVN client software should have a similar function in a context menu or similar.

Deploy workflow

Ideally you checkout the repo on your production server and then run composer update to install all dependencies. If you don't have terminal access or have other troubles with that I recommend you download a fresh copy of your repo and run composer udpate. Then upload it to your server.