Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProjectInfo.php

function ProjectInfo::isInstalledVersionSafe

Checks if the installed version of this project is safe to use.

Return value

bool TRUE if the installed version of this project is secure, supported, and published. Otherwise, or if the project information could not be retrieved, returns FALSE.

File

core/modules/package_manager/src/ProjectInfo.php, line 205

Class

ProjectInfo
Defines a class for retrieving project information from Update module.

Namespace

Drupal\package_manager

Code

public function isInstalledVersionSafe() : bool {
    $project_data = $this->getProjectInfo();
    if ($project_data) {
        $unsafe = [
            UpdateManagerInterface::NOT_SECURE,
            UpdateManagerInterface::NOT_SUPPORTED,
            UpdateManagerInterface::REVOKED,
        ];
        return !in_array($project_data['status'], $unsafe, TRUE);
    }
    // If we couldn't get project data, assume the installed version is unsafe.
    return FALSE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal