Skip to content

Latest commit

 

History

History
99 lines (80 loc) · 2.89 KB

File metadata and controls

99 lines (80 loc) · 2.89 KB

Versions updater

php-versions

Container to retrieve php versions infos programmatically.

Created to replace fetching infos from php.net website, as a DDOS prevention mechanism has been implemented, preventing people to use it programmatically.

Active/Supported versions

See actives.json file, content is the same as https://www.php.net/releases/active.php

Example with 7.4+ versions:

{
    "7": {
        "7.4": { [...Original content...] },
    },
    "8": {
        "8.0": { [...Original content...] },
        "8.1": { [...Original content...] },
        [...]
    }

Tip

  • Retrieve lowest supported version:
    bin/fetch_lowest_supported_version.sh
    Output: 7.4
  • Retrieve latest supported version:
    bin/fetch_latest_supported_version.sh
    Output: 8.1

QA releases

See qa-releases.json file, content mostly comes from https://www.php.net/release-candidates.php?format=json but is filtered and enhanced.

Caution

Be aware that the list may be empty !

In that case, it means there is no QA releases to test at this point in time

The original content is filtered to remove versions without any releases available.

Additional properties are added:

  • version: The long version (e.g. X.Y.Z)
  • short_version: Major and minor version (e.g. X.Y)
  • major_version: Only the major version (e.g. X)
  • supported: Whether the version is supported (=active) or not.

Resulting output resemble to the one use for actives.json file !

Example with 8.5 version:

{
  "8": {
    "8.4": {
      [...Original content...]
      "version": "8.4.12",
      "short_version": "8.4",
      "major_version": "8",
      "supported": true
    },
    "8.5": {
      [...Original content...]
      "version": "8.5.0",
      "short_version": "8.5",
      "major_version": "8",
      "supported": false
    }
  }
}

Tip

Retrieve nightly version:

bin/fetch_nightly_version.sh

Output: 8.5 or null
⚠️⚠️⚠️ When a nightly version becomes active, there is a period of time during which there is no more nightly version !
In that case, the script will output null, it's up to the caller to manage the case !


Automatic updates

  • Version files are updated each week on Sunday morning thanks to update-versions workflow

Conditional requests - GitHub quota

In case you use gitHub API, you can leverage conditional requests mechanism to avoid consuming uselessly your quota if file hasn't been updated since your last fetch