homebrew-core/php 和 shivammathur/homebrew-php 之间的区别

Difference between homebrew-core/php and shivammathur/homebrew-php

Homebrew 拥有适用于所有 PHP 版本的内部 PHP 公式。

brew install php
brew install php@8.0
...

但是还有一个 tap (shivammathur/homebrew-php) 可用于安装 PHP 个版本。

brew tap shivammathur/php
brew install shivammathur/php/php
brew install shivammathur/php/php@8.0
...

我遇到过一篇博客,内容如下:

You can either use the built-in php recipe, but I recommend to use the shivammathur/homebrew-php tap.

这让我想知道 shivammathur/homebrew-php 存在背后的原因是什么,而且为什么它被认为优于内部公式?

PHP shivammathur/homebrew-php 提供的版本:5.6、7.0、7.1、7.2、7.3、7.4、8.0、8.1、8.2

PHP homebrew/homebrew-core 提供的版本:7.2、7.3、7.4、8.0、8.1

请注意,官方 homebrew/homebrew-core tap 没有预发布的 8.2 版本和较旧的 5.6、7.0 和 7.1 版本。因此,不建议将特定 PHP 版本依赖于 homebrew/homebrew-core,因为它们可能目前不可用或将来会被删除。对于这种情况,应改用 shivammathur/homebrew-php 等第三方分流器。 (理想情况下,开发人员应该更新他们的应用程序以与最新的稳定 PHP 版本兼容,但有时这会花费太长时间,甚至可能是不可能的。)

来自Why is it so hard to install old versions of homebrew-core packages?

The philosophy of Homebrew is that we do not care that much about old versions of software. This is how Homebrew was designed, and how it has worked for the last 10 years.

Some people confuse Homebrew with virtualenvs / conda / nix, which surely provide a better support for older versions and different build environments. We are not doing this and do not plan to do this in a foreseable future. Our audience is also not the same.

But support for old versions is not totally zero in Homebrew: you can host an old formula in a tap if you want to maintain it, or we have some versioned formuale (example python@3.8 and python@3.7), because we thought these were really important and deserved to be maintained by us. But we try to avoid too many of these and there are strict rules around versioned formulae.

So it is totally doable to build your own collection of homebrew formulae for your company. We even introduced the possibility to build bottles and host them yourself (for free) a few days/weeks ago: https://brew.sh/2020/11/18/homebrew-tap-with-bottles-uploaded-to-github-releases/.

来自Acceptable Formulae ¶ Niche (or self-submitted) stuff

The software in question must:

  • be maintained (i.e. the last release wasn’t ages ago, it works without patching on all Homebrew-supported OS versions and has no outstanding, unpatched security vulnerabilities)
  • be known
  • be stable (e.g. not declared “unstable” or “beta” by upstream)
  • be used
  • have a homepage

We will reject formulae that seem too obscure, partly because they won’t get maintained and partly because we have to draw the line somewhere.