class ManageOptions (View source)

internal  
 

Per-project options from the 'extras' section of the composer.json file.

Projects that describe scaffold files do so via their scaffold options. This data is pulled from the 'drupal-scaffold' portion of the extras section of the project data.

Properties

protected Composer $composer

The Composer service.

Methods

__construct(Composer $composer)

ManageOptions constructor.

getOptions()

Gets the root-level scaffold options for this project.

packageOptions(PackageInterface $package)

Gets the scaffold options for the stipulated project.

getLocationReplacements()

Creates an interpolator for the 'locations' element.

ensureLocations()

Ensures that all of the locations defined in the scaffold files exist.

Details

__construct(Composer $composer)

ManageOptions constructor.

Parameters

Composer $composer

The Composer service.

ScaffoldOptions getOptions()

Gets the root-level scaffold options for this project.

Return Value

ScaffoldOptions

The scaffold options object.

ScaffoldOptions packageOptions(PackageInterface $package)

Gets the scaffold options for the stipulated project.

Parameters

PackageInterface $package

The package to fetch the scaffold options from.

Return Value

ScaffoldOptions

The scaffold options object.

Interpolator getLocationReplacements()

Creates an interpolator for the 'locations' element.

The interpolator returned will replace a path string with the tokens defined in the 'locations' element.

Note that only the root package may define locations.

Return Value

Interpolator

Interpolator that will do replacements in a string using tokens in 'locations' element.

protected ensureLocations()

Ensures that all of the locations defined in the scaffold files exist.

Create them on the filesystem if they do not.