/**
* Commits all changes made by Composer.
*
* @subcommand commit-composer-changes
*/
public function commitComposerChanges($args, $assoc_args)
{
if (!VersionPress::isActive()) {
WP_CLI::error('VersionPress is not active. Changes will be not committed.');
}
$pluginsAndThemesBeforeUpdate = get_transient($this->pluginsThemesTransient);
delete_transient($this->pluginsThemesTransient);
$currentPluginsAndThemes = $this->getPackages();
$plugins = array_merge($pluginsAndThemesBeforeUpdate['plugins'], $currentPluginsAndThemes['plugins']);
$themes = array_merge($pluginsAndThemesBeforeUpdate['themes'], $currentPluginsAndThemes['themes']);
$changes = $this->detectChanges();
$installedPackages = $changes['installed'];
$removedPackages = $changes['removed'];
$updatedPackages = $changes['updated'];
$this->forceRelatedActions('install', $installedPackages, $plugins, $themes);
$this->forceRelatedActions('delete', $removedPackages, $plugins, $themes);
$this->forceRelatedActions('update', $updatedPackages, $plugins, $themes);
}