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

Breadcrumb

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

function Hg::getVersion

Retrieves the current hg version.

Return value

string|null The hg version number, if present.

2 calls to Hg::getVersion()
Hg::throwException in vendor/composer/composer/src/Composer/Util/Hg.php
HgDownloader::doDownload in vendor/composer/composer/src/Composer/Downloader/HgDownloader.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Util/Hg.php, line 110

Class

Hg
@author Jonas Renaudot <jonas.renaudot@gmail.com>

Namespace

Composer\Util

Code

public static function getVersion(ProcessExecutor $process) : ?string {
    if (false === self::$version) {
        self::$version = null;
        if (0 === $process->execute([
            'hg',
            '--version',
        ], $output) && Preg::isMatch('/^.+? (\\d+(?:\\.\\d+)+)(?:\\+.*?)?\\)?\\r?\\n/', $output, $matches)) {
            self::$version = $matches[1];
        }
    }
    return self::$version;
}

API Navigation

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