是否可以在 PHP 中解析并应用补丁文件?

发布于 2024-09-06 03:15:44 字数 80 浏览 0 评论 0原文

这个想法是让 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南…巷孤猫 2024-09-13 03:15:45

PECL xdiff 库可以生成差异并将其应用于常规 PHP 变量中的数据。

There's the PECL xdiff library which can generate diffs from and apply them to data in regular PHP variables.

俯瞰星空 2024-09-13 03:15:45

看看 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文