In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you an example of composer update project using VCS source, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
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 in the vendor package. However, modifying the vendor package can easily lead to a problem, that is, the version is not easy to manage. If you composer update, it's easy to overwrite the modified code. Setting the repository management of composer as the vcs source solves this problem very well.
The full name of VCS is Version Control System, which means version management system. According to composer official documents, composer now supports version management systems such as Git, Subversion, Mercurial and Fossil. If you use Github's git source, Bitbucket's git and merurial source, composer can obtain the zip package directly through API. If it is another source, you need to have corresponding client support locally.
Suppose there is a scenario where authorA's projectA package is used in the development process, and then I need to make some changes to some part of the code in the package that is more compatible with the local project environment. I can first fork the projectA project code to my own github directory, so that I can modify the project source code (please follow the corresponding open source protocol), and then only need to add these lines of code to the composer.json of the project directory:
{"repositories": [{"type": "vcs", "url": "https://github.com/myAcount/projectA"}]," require ": {" authorA/projectA ":" ~ x.x "}}
Push the locally modified code to your own repository, make sure to type tag, and then execute composer update authorA/projectA in the project directory to use the projectA package that uses your own repository as the source.
The above is all the content of the article "examples of composer update projects using VCS sources". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow 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.