function NoOpStager::stage

File

core/modules/package_manager/tests/modules/package_manager_bypass/src/NoOpStager.php, line 46

Class

NoOpStager
A composer-stager Stager implementation that does nothing, except logging.

Namespace

Drupal\package_manager_bypass

Code

public function stage(array $composerCommand, PathInterface $activeDir, PathInterface $stagingDir, ?OutputCallbackInterface $callback = NULL, ?int $timeout = ProcessInterface::DEFAULT_TIMEOUT) : void {
  $this->saveInvocationArguments($composerCommand, $stagingDir, $timeout);
  $this->throwExceptionIfSet();
  // If desired, simulate a change to the lock file (e.g., as a result of
  // running `composer update`).
  $lockFile = new JsonFile($stagingDir->absolute() . '/composer.lock');
  $changeLockFile = $this->state
    ->get(static::class . ' lock', TRUE);
  if ($changeLockFile && $lockFile->exists()) {
    $data = $lockFile->read();
    $data['_time'] = microtime();
    $lockFile->write($data);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.