function SvnDownloader::doUpdate
@inheritDoc
Overrides VcsDownloader::doUpdate
File
-
vendor/
composer/ composer/ src/ Composer/ Downloader/ SvnDownloader.php, line 70
Class
- SvnDownloader
- @author Ben Bieker <mail@ben-bieker.de> @author Till Klampaeckel <till@php.net>
Namespace
Composer\DownloaderCode
protected function doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url) : PromiseInterface {
SvnUtil::cleanEnv();
$ref = $target->getSourceReference();
if (!$this->hasMetadataRepository($path)) {
throw new \RuntimeException('The .svn directory is missing from ' . $path . ', see https://getcomposer.org/commit-deps for more information');
}
$util = new SvnUtil($url, $this->io, $this->config, $this->process);
$flags = [];
if (version_compare($util->binaryVersion(), '1.7.0', '>=')) {
$flags[] = '--ignore-ancestry';
}
$this->io
->writeError(" Checking out " . $ref);
$this->execute($target, $url, array_merge([
'svn',
'switch',
], $flags), sprintf("%s/%s", $url, $ref), $path);
return \React\Promise\resolve(null);
}