Class JGithubPackageRepositoriesDownloads
-
JGithubObject
-
JGithubPackage
-
JGithubPackageRepositoriesDownloads
Methods summary
public
object
|
#
getList( string $owner, string $repo )
List downloads for a repository.
List downloads for a repository.
Parameters
- $owner
string - $owner The name of the owner of the GitHub repository.
- $repo
string - $repo The name of the GitHub repository.
Returns
object
Since
3.3 (CMS)
|
public
object
|
#
get( string $owner, string $repo, integer $id )
Get a single download.
Parameters
- $owner
string - $owner The name of the owner of the GitHub repository.
- $repo
string - $repo The name of the GitHub repository.
- $id
integer - $id The id of the download.
Returns
object
Since
3.3 (CMS)
|
public
object
|
#
create( string $owner, string $repo, string $name, string $size, string $description = '', string $content_type = '' )
Create a new download (Part 1: Create the resource).
Create a new download (Part 1: Create the resource).
Creating a new download is a two step process. You must first create a new
download resource.
Parameters
- $owner
string - $owner The name of the owner of the GitHub repository.
- $repo
string - $repo The name of the GitHub repository.
- $name
string - $name The name.
- $size
string - $size Size of file in bytes.
- $description
string - $description The description.
- $content_type
string - $content_type The content type.
Returns
object
Since
3.3 (CMS)
|
public
boolean
|
#
upload( string $key, string $acl, string $success_action_status, string $filename, string $awsAccessKeyId, string $policy, string $signature, string $content_type, string $file )
Create a new download (Part 2: Upload file to s3).
Create a new download (Part 2: Upload file to s3).
Now that you have created the download resource, you can use the information
in the response to upload your file to s3. This can be done with a POST to the
s3_url you got in the create response. Here is a brief example using curl:
curl \ -F "key=downloads/octocat/Hello-World/new_file.jpg" \ -F
"acl=public-read" \ -F "success_action_status=201" \ -F "Filename=new_file.jpg"
\ -F "AWSAccessKeyId=1ABCDEF..." \ -F "Policy=ewogIC..." \ -F
"Signature=mwnF..." \ -F "Content-Type=image/jpeg" \ -F "file=@new_file.jpg" \
https://github.s3.amazonaws.com/
NOTES The order in which you pass these fields matters! Follow the order
shown above exactly. All parameters shown are required and if you excluded or
modify them your upload will fail because the values are hashed and signed by
the policy.
More information about using the REST API to interact with s3 can be found
here: http://docs.amazonwebservices.com/AmazonS3/latest/API/
Parameters
- $key
string - $key Value of path field in the response.
- $acl
string - $acl Value of acl field in the response.
- $success_action_status
string - $success_action_status 201, or whatever you want to get back.
- $filename
string - $filename Value of name field in the response.
- $awsAccessKeyId
string - $awsAccessKeyId Value of accesskeyid field in the response.
- $policy
string - $policy Value of policy field in the response.
- $signature
string - $signature Value of signature field in the response.
- $content_type
string - $content_type Value of mime_type field in the response.
- $file
string - $file Local file. Example assumes the file existing in the directory where you
are running the curl command. Yes, the @ matters.
Returns
boolean
Since
3.3 (CMS)
|
public
object
|
#
delete( string $owner, string $repo, integer $id )
Delete a download.
Parameters
- $owner
string - $owner The name of the owner of the GitHub repository.
- $repo
string - $repo The name of the GitHub repository.
- $id
integer - $id The id of the download.
Returns
object
Since
3.3 (CMS)
|
__get()
__construct()
,
fetchUrl()
,
processResponse()
Magic methods summary
Properties summary
$name
,
$packages
$client
,
$options