You are here

function hackedProjectWebDownloader::get_destination in Hacked! 6.2

Same name and namespace in other branches
  1. 7.2 includes/hackedProjectWebDownloader.inc \hackedProjectWebDownloader::get_destination()

Returns a directory to save the downloaded project into.

2 calls to hackedProjectWebDownloader::get_destination()
hackedProjectWebDownloader::get_final_destination in includes/hacked_project.inc
Returns the final destination of the unpacked project.
hackedProjectWebFilesDownloader::download in includes/hacked_project.inc
Download the remote files to the local filesystem.
1 method overrides hackedProjectWebDownloader::get_destination()
hackedProjectWebCVSDownloader::get_destination in includes/hacked_project.inc
Returns a directory to save the downloaded project into.

File

includes/hacked_project.inc, line 363

Class

hackedProjectWebDownloader
Base class for downloading remote versions of projects.

Code

function get_destination() {
  $type = $this->project->project_type;
  $name = $this->project->name;
  $version = $this->project->existing_version;
  $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}";
}