Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RequireCommand.php

function RequireCommand::revertComposerFile

3 calls to RequireCommand::revertComposerFile()
RequireCommand::doUpdate in vendor/composer/composer/src/Composer/Command/RequireCommand.php
RequireCommand::execute in vendor/composer/composer/src/Composer/Command/RequireCommand.php
RequireCommand::updateRequirementsAfterResolution in vendor/composer/composer/src/Composer/Command/RequireCommand.php

File

vendor/composer/composer/src/Composer/Command/RequireCommand.php, line 621

Class

RequireCommand
@author Jérémy Romey <jeremy@free-agent.fr> @author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Command

Code

private function revertComposerFile() : void {
    $io = $this->getIO();
    if ($this->newlyCreated) {
        $io->writeError("\n" . '<error>Installation failed, deleting ' . $this->file . '.</error>');
        unlink($this->json
            ->getPath());
        if (file_exists($this->lock)) {
            unlink($this->lock);
        }
    }
    else {
        $msg = ' to its ';
        if ($this->lockBackup) {
            $msg = ' and ' . $this->lock . ' to their ';
        }
        $io->writeError("\n" . '<error>Installation failed, reverting ' . $this->file . $msg . 'original content.</error>');
        file_put_contents($this->json
            ->getPath(), $this->composerBackup);
        if ($this->lockBackup) {
            file_put_contents($this->lock, $this->lockBackup);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal