[英]PHP composer, don't lose package code changes on update
I am working on a project which requires many edits to be made on the required packages.我正在开发一个项目,该项目需要对所需的包进行许多编辑。 Everything works just fine until an update comes on the horizon.
一切正常,直到更新即将到来。 Once a package gets updated, all made changes on it are instantly replaced with the newer version(even there is no actual update on the updated file).
一旦 package 得到更新,所有对其进行的更改都会立即替换为较新的版本(即使更新的文件没有实际更新)。
My question is, how can I keep my edits over the modified packages and still be able to run composer update
without the fear of losing my edits and starting all over again.我的问题是,我怎样才能在修改后的包上保留我的编辑,并且仍然能够运行
composer update
而不必担心丢失我的编辑并重新开始。
Short answer : You can't.简短的回答:你不能。 The update will always pull the code as it exists in the repository and overwrite the local copy.
更新将始终提取存储库中存在的代码并覆盖本地副本。 That's how packages work.
这就是包的工作方式。
Longer answer : You can't.更长的答案:你不能。 Editing packages is a bad idea .
编辑包是个坏主意。 If you find you need to edit the package you are implementing it wrong as there should be no need to modify that code.
如果您发现需要编辑 package,则说明您实施错误,因为不需要修改该代码。 If you need additional functionality you can:
如果您需要其他功能,您可以:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.