Joomla CMS
3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
|
Fonctions membres publiques | |
getList ($owner, $repo) | |
get ($owner, $repo, $id) | |
create ($owner, $repo, $name, $size, $description='', $contentType='') | |
upload ($key, $acl, $successActionStatus, $filename, $awsAccessKeyId, $policy, $signature, $contentType, $file) | |
delete ($owner, $repo, $id) | |
Fonctions membres publiques hérités de JGithubPackage | |
__get ($name) | |
Fonctions membres publiques hérités de JGithubObject | |
__construct (Registry $options=null, JGithubHttp $client=null) | |
Membres hérités additionnels | |
Fonctions membres protégées hérités de JGithubObject | |
fetchUrl ($path, $page=0, $limit=0) | |
processResponse (JHttpResponse $response, $expectedCode=200, $decode=true) | |
Attributs protégés hérités de JGithubPackage | |
$name = '' | |
$packages = array() | |
Attributs protégés hérités de JGithubObject | |
$options | |
$client | |
GitHub API Repositories Downloads class for the Joomla Platform.
The downloads API is for package downloads only. If you want to get source tarballs you should use https://developer.github.com/v3/repos/contents/#get-archive-link instead.
https://developer.github.com/v3/repos/downloads
create | ( | $owner, | |
$repo, | |||
$name, | |||
$size, | |||
$description = '' , |
|||
$contentType = '' |
|||
) |
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.
string | $owner | The name of the owner of the GitHub repository. |
string | $repo | The name of the GitHub repository. |
string | $name | The name. |
string | $size | Size of file in bytes. |
string | $description | The description. |
string | $contentType | The content type. |
Références $data, $description, $name, et $path.
delete | ( | $owner, | |
$repo, | |||
$id | |||
) |
get | ( | $owner, | |
$repo, | |||
$id | |||
) |
getList | ( | $owner, | |
$repo | |||
) |
List downloads for a repository.
string | $owner | The name of the owner of the GitHub repository. |
string | $repo | The name of the GitHub repository. |
Références $path.
upload | ( | $key, | |
$acl, | |||
$successActionStatus, | |||
$filename, | |||
$awsAccessKeyId, | |||
$policy, | |||
$signature, | |||
$contentType, | |||
$file | |||
) |
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/
string | $key | Value of path field in the response. |
string | $acl | Value of acl field in the response. |
string | $successActionStatus | 201, or whatever you want to get back. |
string | $filename | Value of name field in the response. |
string | $awsAccessKeyId | Value of accesskeyid field in the response. |
string | $policy | Value of policy field in the response. |
string | $signature | Value of signature field in the response. |
string | $contentType | Value of mime_type field in the response. |
string | $file | Local file. Example assumes the file existing in the directory where you are running the curl command. Yes, the @ matters. |