In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Xiaobian to share with you how to use VCS source composer update project, I believe most people still do not know how, so share this article for everyone's reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!
We will inevitably encounter this situation in PHP development. When using composer as a package management tool, part of the code of an open source component that the project depends on needs to be modified according to the needs of the whole project. This can be achieved by modifying the component source code inside the vendor package. However, modifying the vendor package easily leads to a problem, that is, the version is not easy to manage. If the composer update operation is carried out, it is easy to overwrite the modified code. Setting the repository management of the composer to vcs source solves this problem well.
VCS full name Version Control System, meaning version management system, according to the official documentation of composer, now composer supports Git, Subversion, Mercurial and Fossil version management systems, where if you use Github git source, Bitbucket git and merial source, composer is directly through the API to obtain zip package, if it is other sources, you need to have the corresponding local client support.
Suppose there is such a scenario, in the development process using authorA projectA package, and then I need to make some changes to a part of the package code more suitable for the local project environment, you can first project A project code fork to their own github directory, so that you can modify the project source code (please follow the corresponding open source protocol), and then in the project directory composer.json only need to add these lines of code:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/myAcount/projectA" } ], "require": { "authorA/projectA": "~x.x" }}
Push the locally modified code into your own repository, note that you have to tag it, and then execute composer update authorA/projectA in the project directory to use the projectA package that uses your own repository as the source.
That's all for the "composer update project how to use VCS sources" article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.