简体   繁体   中英

Keep local and production composer.json files in sync?

I am working on a large project with a lot of git repositories. I can easily keep them in sync like this:

https://getcomposer.org/doc/05-repositories.md#path

"repositories": [
    { "type": "path",  "url": "../another-component" },
    { "type": "path",  "url": "../yet-another-component" }
]

If I run composer this will create a symbolic link inside my vendor folder for each repository provided. This way whenever I update one of the repositories outside my main app repository changes will be reflected immediately.

This is a perfect local development solution but on production I would just like to have a composer file that points to the online Github repositories and pull the repositories from Github.

Of course this composer file would look a bit different since the types would be set to vcs and the url's would point to Github instead of being relative paths.

How do people do this for local/production setups? Do you just maintain 2 separate composer files, one for local development and another for production?

This would mean whenever I add another repository to my codebase I have to remember to update it in 2 places or my entire codebase breaks down.

由于您的组件似乎已经在线托管,因此我建议您仅让作曲家从Github中提取它们,并像处理其他任何依赖项(无论是开发还是生产中的依赖项)一样管理它们。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM