Skip to content

davahome/self-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

self-update

Provides functionality for implementing a github api based self-update functionality (for private repositories)

Installation

php composer.phar require davahome/self-update

Usage

use DavaHome\SelfUpdate\AssetFileDownloader;

$assetFileDownloader = new AssetFileDownloader('davahome', 'self-update', '<TOKEN>');

// 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);

About

A php library for using the github api to implement a self-update functionality

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages