public function ReleaseInfo::checkProject

8.0.x ReleaseInfo.php public ReleaseInfo::checkProject($request, $type = NULL)
7.x ReleaseInfo.php public ReleaseInfo::checkProject($request, $type = NULL)
master ReleaseInfo.php public ReleaseInfo::checkProject($request, $type = NULL)

Check if a project is available in the update service.

Optionally check for consistency by comparing given project type and the type obtained from the update service.

Parameters

array $request: A request array.

string $type: Optional. If provided, will do a consistent check of the project type.

Return value

boolean True if the project exists and type matches.

File

lib/Drush/UpdateService/ReleaseInfo.php, line 212
Drush release info engine for update.drupal.org and compatible services.

Namespace

Drush\UpdateService

Class

ReleaseInfo
Release info engine class.

Code

public function checkProject($request, $type = NULL) {
  $project_release_info = $this->get($request);
  if (!$project_release_info) {
    return FALSE;
  }
  if ($type) {
    if ($project_release_info->getType() != $type) {
      return FALSE;
    }
  }

  return TRUE;
}