You are here

public static function Command::update in Composer Manager 8

Rebuilds the root package, then calls 'composer update'.

File

src/Composer/Command.php, line 32

Class

Command
Callbacks for Composer commands defined by Composer Manager.

Namespace

Drupal\composer_manager\Composer

Code

public static function update(Event $event) {
  $package_manager = self::getPackageManager();
  $package_manager
    ->rebuildRootPackage();

  // Change the requested command to 'update', and rerun composer.
  $command_index = array_search('drupal-update', $_SERVER['argv']);
  $_SERVER['argv'][$command_index] = 'update';
  $application = new Application();
  $application
    ->run();
}