You are here

function _hacked_download_archive in Hacked! 7.3

Download archive.

1 call to _hacked_download_archive()
_hacked_check_project in ./hacked.helpers.inc
Check core, module or theme.

File

./hacked.helpers.inc, line 98
Contain list of helpers for the module.

Code

function _hacked_download_archive($project, $version) {
  $filename = $project . '-' . $version . '.zip';
  $url = 'https://ftp.drupal.org/files/projects/' . $filename;
  $tempdir = _hacked_get_temp_dir();
  $filepath = $tempdir . '/' . $filename;
  $is_downloaded = file_put_contents($filepath, fopen($url, 'r'));
  return $is_downloaded ? $filepath : FALSE;
}