是否可以在 PHP 中解析并应用补丁文件?
这个想法是让 PHP 脚本解析给定的 .patch 文件并相应地应用给定的补丁。假设脚本无法访问命令行,因此脚本必须自行进行解析。某处有图书馆吗?
The idea is to have a PHP script parse a given .patch file and will apply the given patch accordingly. Assume that the script has no access to command line so the script will have to do the parsing itself. Is there a library somewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PECL xdiff 库可以生成差异并将其应用于常规 PHP 变量中的数据。
There's the PECL xdiff library which can generate diffs from and apply them to data in regular PHP variables.
看看 https://github.com/ptlis/diff-parser
这是一个非常可靠的lib,正如它所说的那样
Check out https://github.com/ptlis/diff-parser
This is a really solid lib, does exactly what it says on the tin