function highcharttable_download_and_extract_zip in HighchartTable 7
Download a zipped library from the specified URL to a destination directory.
Parameters
string $url: The url to the .zip to be downloaded.
string $dest_path: The path relative to the Drupal root to put the extracted .zip Defaults to sites/all/libraries
Return value
boolean TRUE when the .zip could be downloaded AND extracted successfully
1 call to highcharttable_download_and_extract_zip()
- highcharttable_drush_download_libraries in drush/
highcharttable.drush.inc - Command to download the Highcharts and HighchartTable libraries.
File
- drush/
highcharttable.drush.inc, line 100 - Drush integration for HighchartTable.
Code
function highcharttable_download_and_extract_zip($url, $dest_path = 'sites/all/libraries') {
$zip = drush_download_file($url);
if ($zip) {
if (drush_tarball_extract($zip, $dest_path)) {
drush_log(dt('@url downloaded and extracted.', array(
'@url' => $url,
)), 'success');
}
else {
drush_log(dt('@zip was downloaded, but could not be extracted.', array(
'@zip' => $zip,
)), 'error');
return FALSE;
}
}
else {
drush_log(dt('Drush could not download @url', array(
'@url' => $url,
)), 'error');
}
return $zip;
}