You are here

function hackedProjectWebDevDownloader::download_link in Hacked! 8.2

Get download information for the dev release.

Return value

array 'module' => The name of the project. 'giturl' => The upstream URL of the project. 'branch' => The development branch the snapshot was taken from. 'timestamp' => When the project was originally downloaded.

1 call to hackedProjectWebDevDownloader::download_link()
hackedProjectWebDevDownloader::download in src/hackedProjectWebDevDownloader.php
Download the version of the project to compare.

File

src/hackedProjectWebDevDownloader.php, line 22

Class

hackedProjectWebDevDownloader
Downloads a development snapshot of a project using Git.

Namespace

Drupal\hacked

Code

function download_link() {
  $info = array();
  $project =& $this->project->project_info;

  // Get the branch we're on.
  $release = strtok($project['existing_version'], '-') . '-' . $project['existing_major'] . '.x-dev';
  $branch = $project['releases'][$release]['tag'];

  // Assign some information depending on the project type.
  if ($project['project_type'] == 'core') {

    // Special handling for core.
    $info['module'] = 'drupal';
  }
  else {

    // Contrib.
    $info['module'] = $project['name'];
  }

  // Assign all of the other information.
  $info['giturl'] = 'https://git.drupal.org/project/' . $project['name'] . '.git';
  $info['branch'] = $branch;
  $info['timestamp'] = $project['datestamp'];

  // Return it.
  return $info;
}