更新 PHPMailer 的推荐方法是什么?

What is the recommended way to update PHPMailer?

我继承了一个未维护的 Web 服务器,其中包含一个包含 PHPMailer 5.2.13 的自定义 Web 应用程序。

它似乎是使用 GIT 安装的,推荐的升级到最新版本的方法是什么?

作为the readme says, the best way to install PHPMailer is with composer。这样 运行 composer update 将为您提供最新的稳定版本,无论它是什么。 PHPMailer 不保证 master 分支总是可用,但标记的版本是可用的。如果您想使用 git 手动更新到稳定版本,您可以手动检查与最新命名版本(当前 v5.2.21)关联的 git 标签:

git fetch
git checkout v5.2.21

您需要确保您的 git 远程指向上游 PHPMailer 存储库 (https://github.com/PHPMailer/PHPMailer.git) 而不是您自己的克隆。