Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
fix : fixed incorrect interface on curl downloader (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
prisis authored Oct 23, 2019
1 parent 1ac7531 commit 093c61e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/Prefetcher/Downloader/CurlDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,16 @@ public function __construct()
/**
* Download the package content.
*
* @param string $url
* @param resource|string $context
* @param null|string $file
* This must stay in sync with the RemoteFilesystem::getRemoteContents interface.
*
* @param string $originUrl
* @param string $url
* @param null|resource|string $context
* @param null|string $file
*
* @return array
*/
public function get(string $url, $context, ?string $file): array
public function get(string $originUrl, string $url, $context, ?string $file): array
{
$params = \stream_context_get_params($context);
$ch = \curl_init();
Expand Down
2 changes: 1 addition & 1 deletion src/Prefetcher/Downloader/ParallelDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ protected function getRemoteContents($originUrl, $fileUrl, $context, array &$res
return $result;
}

if (\preg_match('/^https?:/', $originUrl) !== 1 || $this->downloader === null) {
if ($this->downloader === null || \preg_match('/^https?:/', $originUrl) !== 1) {
return parent::getRemoteContents($originUrl, $fileUrl, $context, $responseHeaders);
}

Expand Down

0 comments on commit 093c61e

Please sign in to comment.