You are here

protected function CliCommandWrapper::downloadFile in CKEditor Media Embed Plugin 8

Download a file.

Parameters

string $url: The full URL to the file to download.

string $destination: The location to place the file.

Return value

bool Returns TRUE if the file was downloaded as expected, otherwise FALSE.

1 call to CliCommandWrapper::downloadFile()
CliCommandWrapper::downloadCKEditorFull in src/Command/CliCommandWrapper.php

File

src/Command/CliCommandWrapper.php, line 218

Class

CliCommandWrapper
Class CLICommands.

Namespace

Drupal\ckeditor_media_embed\Command

Code

protected function downloadFile($url, $destination) {
  $this->httpClient
    ->get($url, [
    'sink' => $destination,
  ]);
  return file_exists($destination);
}