Package options must be passed as argument to downloader
parent
2e2b66b16e
commit
d4043b6b9a
|
@ -103,7 +103,7 @@ class FileDownloader implements DownloaderInterface
|
||||||
$retries = 3;
|
$retries = 3;
|
||||||
while ($retries--) {
|
while ($retries--) {
|
||||||
try {
|
try {
|
||||||
$this->rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress);
|
$this->rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress, $package->getOptions());
|
||||||
break;
|
break;
|
||||||
} catch (TransportException $e) {
|
} catch (TransportException $e) {
|
||||||
// if we got an http response with a proper code, then requesting again will probably not help, abort
|
// if we got an http response with a proper code, then requesting again will probably not help, abort
|
||||||
|
@ -132,7 +132,7 @@ class FileDownloader implements DownloaderInterface
|
||||||
) {
|
) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
$this->rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress);
|
$this->rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress, $package->getOptions());
|
||||||
} else {
|
} else {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,10 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('getDistUrl')
|
->method('getDistUrl')
|
||||||
->will($this->returnValue('http://example.com/script.js'))
|
->will($this->returnValue('http://example.com/script.js'))
|
||||||
;
|
;
|
||||||
|
$packageMock->expects($this->atLeastOnce())
|
||||||
|
->method('getOptions')
|
||||||
|
->will($this->returnValue(array()))
|
||||||
|
;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$path = sys_get_temp_dir().'/'.md5(time().mt_rand());
|
$path = sys_get_temp_dir().'/'.md5(time().mt_rand());
|
||||||
|
@ -130,6 +134,10 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('getDistUrl')
|
->method('getDistUrl')
|
||||||
->will($this->returnValue('http://example.com/script.js'))
|
->will($this->returnValue('http://example.com/script.js'))
|
||||||
;
|
;
|
||||||
|
$packageMock->expects($this->atLeastOnce())
|
||||||
|
->method('getOptions')
|
||||||
|
->will($this->returnValue(array()))
|
||||||
|
;
|
||||||
$packageMock->expects($this->any())
|
$packageMock->expects($this->any())
|
||||||
->method('getDistSha1Checksum')
|
->method('getDistSha1Checksum')
|
||||||
->will($this->returnValue('invalid'))
|
->will($this->returnValue('invalid'))
|
||||||
|
|
|
@ -30,6 +30,10 @@ class ZipDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('getDistUrl')
|
->method('getDistUrl')
|
||||||
->will($this->returnValue('file://'.__FILE__))
|
->will($this->returnValue('file://'.__FILE__))
|
||||||
;
|
;
|
||||||
|
$packageMock->expects($this->atLeastOnce())
|
||||||
|
->method('getOptions')
|
||||||
|
->will($this->returnValue(array()))
|
||||||
|
;
|
||||||
|
|
||||||
$io = $this->getMock('Composer\IO\IOInterface');
|
$io = $this->getMock('Composer\IO\IOInterface');
|
||||||
$config = $this->getMock('Composer\Config');
|
$config = $this->getMock('Composer\Config');
|
||||||
|
|
Loading…
Reference in New Issue