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

Breadcrumb

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

function VersionGuesser::guessFossilVersion

Return value

array{version: string|null, commit: '', pretty_version: string|null}

1 call to VersionGuesser::guessFossilVersion()
VersionGuesser::guessVersion in vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php
@phpstan-return Version|null

File

vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php, line 372

Class

VersionGuesser
Try to guess the current version number based on different VCS configuration.

Namespace

Composer\Package\Version

Code

private function guessFossilVersion(string $path) : array {
    $version = null;
    $prettyVersion = null;
    // try to fetch current version from fossil
    if (0 === $this->process
        ->execute([
        'fossil',
        'branch',
        'list',
    ], $output, $path)) {
        $branch = trim($output);
        $version = $this->versionParser
            ->normalizeBranch($branch);
        $prettyVersion = 'dev-' . $branch;
    }
    // try to fetch current version from fossil tags
    if (0 === $this->process
        ->execute([
        'fossil',
        'tag',
        'list',
    ], $output, $path)) {
        try {
            $version = $this->versionParser
                ->normalize(trim($output));
            $prettyVersion = trim($output);
        } catch (\Exception $e) {
        }
    }
    return [
        'version' => $version,
        'commit' => '',
        'pretty_version' => $prettyVersion,
    ];
}
RSS feed
Powered by Drupal