You are here

function hackedProjectWebCVSDownloader::get_destination in Hacked! 6.2

Returns a directory to save the downloaded project into.

Overrides hackedProjectWebDownloader::get_destination

1 call to hackedProjectWebCVSDownloader::get_destination()
hackedProjectWebCVSDownloader::download in includes/hacked_project.inc
Download the remote files to the local filesystem.

File

includes/hacked_project.inc, line 574

Class

hackedProjectWebCVSDownloader
Downloads a project using CVS.

Code

function get_destination() {
  $type = $this->project->project_type;
  $name = $this->project->name;
  $info = $this
    ->download_link();

  // Add in the CVS tag here.
  $version = $this->project->existing_version . '-' . $info['tag'];
  $dir = $this
    ->get_temp_directory() . "/{$type}/{$name}";

  // Build the destination folder tree if it doesn't already exists.
  if (!file_check_directory($dir, FILE_CREATE_DIRECTORY) && !mkdir($dir, 0775, TRUE)) {
    watchdog('hacked', 'Failed to create temp directory: %dir', array(
      '%dir' => $dir,
    ), WATCHDOG_ERROR);
    return FALSE;
  }
  return "{$dir}/{$version}";
}