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

Breadcrumb

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

function DiagnoseCommand::checkVersion

Return value

string|\Exception|true

1 call to DiagnoseCommand::checkVersion()
DiagnoseCommand::execute in vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php
Executes the current command.

File

vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php, line 545

Class

DiagnoseCommand
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Command

Code

private function checkVersion(Config $config) {
    $result = $this->checkConnectivityAndComposerNetworkHttpEnablement();
    if ($result !== true) {
        return $result;
    }
    $versionsUtil = new Versions($config, $this->httpDownloader);
    try {
        $latest = $versionsUtil->getLatest();
    } catch (\Exception $e) {
        return $e;
    }
    if (Composer::VERSION !== $latest['version'] && Composer::VERSION !== '@package_version@') {
        return '<comment>You are not running the latest ' . $versionsUtil->getChannel() . ' version, run `composer self-update` to update (' . Composer::VERSION . ' => ' . $latest['version'] . ')</comment>';
    }
    return true;
}

API Navigation

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