Home  >  Article  >  Backend Development  >  How to modify the third-party libraries installed by composer

How to modify the third-party libraries installed by composer

WBOY
WBOYOriginal
2016-08-18 09:15:441743browse

Third-party components loaded through composer. If you need to modify other people's source code, do you need to modify it directly in the vendor?
If you modify it directly, do you also need to include the vendor in version management?

How to usually deal with the problem that third-party packages need to be rewritten?

Reply content:

Third-party components loaded through composer. If you need to modify other people's source code, do you need to change it directly in the vendor?
If you change it directly, do you also need to include the vendor in version management?

How to usually deal with the problem that third-party packages need to be rewritten?

Fork the third-party package, and then composer's own warehouse, so that your modifications to the third-party package can be pushed to your own warehouse, and the latest ones downloaded from composer will be the latest ones modified by you.

What you said upstairs makes sense
As for how composer pushes to its own warehouse, you can refer to the following
https://segmentfault.com/n/13...

@The Bear Who Can Code Usually the components under the vendor are rarely changed. In addition to this solution, are there any other ways?

If it is only used for individual projects, just change the vendor code directly.
Rememberto joinversion management

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn