final class ProjectSecurityData (View source)

internal  This class implements logic to determine security coverage for Drupal core according to Drupal core security policy. It should not be called directly.
 

Calculates a project's security coverage information.

Constants

CORE_MINORS_WITH_SECURITY_COVERAGE

The number of minor versions of Drupal core that receive security coverage.

For example, if this value is 2 and the existing version is 9.0.1, the 9.0.x branch will receive security coverage until the release of version 9.2.0.

SECURITY_COVERAGE_END_DATE_8_8

Define constants for versions with security coverage end dates.

Two types of constants are supported:

  • SECURITY_COVERAGE_ENDDATE[VERSIONMAJOR][VERSION_MINOR]: A date in 'Y-m-d' or 'Y-m' format.
  • SECURITY_COVERAGE_ENDING_WARNDATE[VERSIONMAJOR][VERSION_MINOR]: A date in 'Y-m-d' format.

SECURITY_COVERAGE_ENDING_WARN_DATE_8_8

SECURITY_COVERAGE_END_DATE_8_9

Properties

protected string|null $existingVersion

The existing (currently installed) version of the project.

protected array $releases

Releases as returned by update_get_available().

Methods

createFromProjectDataAndReleases(array $project_data, array $releases)

Creates a ProjectSecurityData object from project data and releases.

array
getCoverageInfo()

Gets the security coverage information for a project.

Details

static ProjectSecurityData createFromProjectDataAndReleases(array $project_data, array $releases)

Creates a ProjectSecurityData object from project data and releases.

Parameters

array $project_data

Project data from Drupal\update\UpdateManagerInterface::getProjects() and processed by update_process_project_info().

array $releases

Project releases as returned by update_get_available().

Return Value

ProjectSecurityData

array getCoverageInfo()

Gets the security coverage information for a project.

Currently only Drupal core is supported.

Return Value

array

The security coverage information, or an empty array if no security information is available for the project. If security coverage is based on release of a specific version, the array will have the following keys:

  • security_coverage_end_version (string): The minor version the existing version will receive security coverage until.
  • additional_minors_coverage (int): The number of additional minor versions the existing version will receive security coverage. If the security coverage is based on a specific date, the array will have the following keys:
  • security_coverage_end_date (string): The month or date security coverage will end for the existing version. It can be in either 'YYYY-MM' or 'YYYY-MM-DD' format.
  • (optional) security_coverage_ending_warn_date (string): The date, in the format 'YYYY-MM-DD', after which a warning should be displayed about upgrading to another version.