function ComponentGenerator::generate
Same name in other branches
- 9 composer/Generator/ComponentGenerator.php \Drupal\Composer\Generator\ComponentGenerator::generate()
- 11.x composer/Generator/ComponentGenerator.php \Drupal\Composer\Generator\ComponentGenerator::generate()
Reconcile Drupal's components whenever composer.lock is updated.
Parameters
\Composer\Script\Event $event: The Composer event.
string $base_dir: Directory where drupal/drupal repository is located.
File
-
composer/
Generator/ ComponentGenerator.php, line 77
Class
- ComponentGenerator
- Reconciles Drupal component dependencies with core.
Namespace
Drupal\Composer\GeneratorCode
public function generate(Event $event, string $base_dir) : void {
$io = $event->getIO();
// General information from drupal/drupal and drupal/core composer.json
// and composer.lock files.
$this->drupalProjectInfo = DrupalCoreComposer::createFromPath($base_dir);
$this->drupalCoreInfo = DrupalCoreComposer::createFromPath($base_dir . '/core');
$changed = FALSE;
/** @var \Symfony\Component\Finder\SplFileInfo $component_composer_json */
foreach ($this->getComponentPathsFinder()
->getIterator() as $component_composer_json) {
$changed |= $this->generateComponentPackage($event, $component_composer_json->getRelativePathname());
}
// Remind the user not to miss files in a patch.
if ($changed) {
$io->write("If you make a patch, ensure that the files above are included.");
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.