From 22689ce0ccb277d2b62756c3be2fbeccd79f1c9e Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Wed, 12 Apr 2017 12:13:53 +0300 Subject: [PATCH] Add GitHub API response to the `Vcs_Reference` instance. This is intended for use in subclasses, e.g. to change the `downloadUrl` from `zipball_url` to an asset URL. --- Puc/v4p1/Vcs/GitHubApi.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Puc/v4p1/Vcs/GitHubApi.php b/Puc/v4p1/Vcs/GitHubApi.php index 3b0cc80..0a6dcfd 100644 --- a/Puc/v4p1/Vcs/GitHubApi.php +++ b/Puc/v4p1/Vcs/GitHubApi.php @@ -50,6 +50,7 @@ if ( !class_exists('Puc_v4p1_Vcs_GitHubApi', false) ): 'version' => ltrim($release->tag_name, 'v'), //Remove the "v" prefix from "v1.2.3". 'downloadUrl' => $this->signDownloadUrl($release->zipball_url), 'updated' => $release->created_at, + 'apiResponse' => $release, )); if ( !empty($release->body) ) { @@ -85,6 +86,7 @@ if ( !class_exists('Puc_v4p1_Vcs_GitHubApi', false) ): 'name' => $tag->name, 'version' => ltrim($tag->name, 'v'), 'downloadUrl' => $this->signDownloadUrl($tag->zipball_url), + 'apiResponse' => $tag, )); } @@ -103,6 +105,7 @@ if ( !class_exists('Puc_v4p1_Vcs_GitHubApi', false) ): $reference = new Puc_v4p1_Vcs_Reference(array( 'name' => $branch->name, 'downloadUrl' => $this->buildArchiveDownloadUrl($branch->name), + 'apiResponse' => $branch, )); if ( isset($branch->commit, $branch->commit->commit, $branch->commit->commit->author->date) ) {