function DrupalCoreComposer::createFromPath

Same name in other branches
  1. 8.9.x composer/Generator/Util/DrupalCoreComposer.php \Drupal\Composer\Generator\Util\DrupalCoreComposer::createFromPath()
  2. 10 composer/Generator/Util/DrupalCoreComposer.php \Drupal\Composer\Generator\Util\DrupalCoreComposer::createFromPath()
  3. 11.x composer/Generator/Util/DrupalCoreComposer.php \Drupal\Composer\Generator\Util\DrupalCoreComposer::createFromPath()

DrupalCoreComposer factory.

Parameters

string $repositoryPath: Path to a directory containing a composer.json and composer.lock files.

Return value

static New DrupalCoreComposer object containing composer.json and lock data.

3 calls to DrupalCoreComposer::createFromPath()
ComponentGenerator::generate in composer/Generator/ComponentGenerator.php
Reconcile Drupal's components whenever composer.lock is updated.
MetapackageUpdateTest::testUpdated in core/tests/Drupal/Tests/Composer/Generator/MetapackageUpdateTest.php
Tests to see if the generated metapackages are in sync with composer.lock.
PackageGenerator::generate in composer/Generator/PackageGenerator.php
Generate Drupal's metapackages whenever composer.lock is updated.

File

composer/Generator/Util/DrupalCoreComposer.php, line 49

Class

DrupalCoreComposer
Utilities for accessing composer.json data from drupal/drupal and drupal/core.

Namespace

Drupal\Composer\Generator\Util

Code

public static function createFromPath(string $repositoryPath) {
    $composerJson = static::loadJsonFromPath("{$repositoryPath}/composer.json");
    $composerLock = static::loadJsonFromPath("{$repositoryPath}/composer.lock");
    return new self($composerJson, $composerLock);
}

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