https://github.com/davahome/github-client
A really simple github client
https://github.com/davahome/github-client
client github php
Last synced: 2 months ago
JSON representation
A really simple github client
- Host: GitHub
- URL: https://github.com/davahome/github-client
- Owner: davahome
- License: gpl-3.0
- Created: 2017-11-22T11:16:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-26T09:13:55.000Z (over 8 years ago)
- Last Synced: 2025-12-14T16:17:11.207Z (6 months ago)
- Topics: client, github, php
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-php-api
Provides functionality for communication with the github using php.
A possible usage of this is the implementation a github api based self-update functionality (for private repositories)
# Installation
```bash
php composer.phar require davahome/github-php-api
```
# Usage
```php
use DavaHome\GithubApi\AssetFileDownloader;
$assetFileDownloader = new AssetFileDownloader('davahome', 'github-api', '');
// Display some release information (optional)
$releaseInformation = $assetFileDownloader->getReleaseInformation();
$date = new \DateTime($releaseInformation['published_at']);
echo 'Version: ', $releaseInformation['tag_name'], PHP_EOL;
echo 'Published: ', $date->format('Y-m-d H:i:s'), PHP_EOL;
// Download the asset
$fileContent = $assetFileDownloader->downloadAsset('file.phar');
file_put_contents('file.phar', $fileContent);
```