You are here

function hackedProjectWebCVSDownloader::download in Hacked! 6.2

Download the remote files to the local filesystem.

Overrides hackedProjectWebDownloader::download

File

includes/hacked_project.inc, line 551

Class

hackedProjectWebCVSDownloader
Downloads a project using CVS.

Code

function download() {
  $dir = $this
    ->get_destination();
  $release_info = $this
    ->download_link();

  // TODO: Only delete if not a TAG.
  if (file_exists($dir)) {
    if ($this
      ->is_cvs_tag($release_info['tag'])) {
      return $dir;
    }
    else {

      // This is not a CVS tag, so we need to re-download.
      $this
        ->remove_dir($dir);
    }
  }
  if (hacked_cvs_checkout($release_info['cvsroot'], $release_info['module'], $dir, $release_info['checkout_folder'], $release_info['tag'])) {
    return $dir;
  }

  // Something went wrong:
  return FALSE;
}