class PackageManagerRequirements

Install time requirements for the package_manager module.

Hierarchy

Expanded class hierarchy of PackageManagerRequirements

File

core/modules/package_manager/src/Install/Requirements/PackageManagerRequirements.php, line 16

Namespace

Drupal\package_manager\Install\Requirements
View source
class PackageManagerRequirements implements InstallRequirementsInterface {
  
  /**
   * {@inheritdoc}
   */
  public static function getRequirements() : array {
    $requirements = [];
    if (Settings::get('testing_package_manager', FALSE) === FALSE) {
      $requirements['testing_package_manager'] = [
        'title' => 'Package Manager',
        'description' => t("Package Manager is available for early testing. To install the module set the value of 'testing_package_manager' to TRUE in your settings.php file."),
        'severity' => RequirementSeverity::Error,
      ];
    }
    // If we're able to check for the presence of the failure marker at all, do
    // it irrespective of the current run phase. If the failure marker is there,
    // the site is in an indeterminate state and should be restored from backup
    // ASAP.
    $service_id = FailureMarker::class;
    if (\Drupal::hasService($service_id)) {
      try {
        \Drupal::service($service_id)->assertNotExists(NULL);
      } catch (FailureMarkerExistsException $exception) {
        $requirements['package_manager_failure_marker'] = [
          'title' => t('Failed Package Manager update detected'),
          'description' => $exception->getMessage(),
          'severity' => RequirementSeverity::Error,
        ];
      }
    }
    return $requirements;
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
PackageManagerRequirements::getRequirements public static function Check installation requirements. Overrides InstallRequirementsInterface::getRequirements

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.