function Composer::setTemplateProjectStability

Same name in other branches
  1. 9 composer/Composer.php \Drupal\Composer\Composer::setTemplateProjectStability()
  2. 11.x composer/Composer.php \Drupal\Composer\Composer::setTemplateProjectStability()

Set the stability of the template projects to match the Drupal version.

Parameters

string $root: Path to root of drupal/drupal repository.

string $version: Semver version that Drupal was set to.

1 call to Composer::setTemplateProjectStability()
Composer::setDrupalVersion in composer/Composer.php
Set the version of Drupal; used in release process and by the test suite.

File

composer/Composer.php, line 80

Class

Composer
Provides static functions for composer script events.

Namespace

Drupal\Composer

Code

protected static function setTemplateProjectStability(string $root, string $version) : void {
    $stability = VersionParser::parseStability($version);
    $templateProjectPaths = static::composerSubprojectPaths($root, 'Template');
    foreach ($templateProjectPaths as $path) {
        $dir = dirname($path);
        exec("composer --working-dir={$dir} config minimum-stability {$stability}", $output, $status);
        if ($status) {
            throw new \Exception('Could not set minimum-stability for template project ' . basename($dir));
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.