htmly/vendor/kanti/hub-updater/example2.php
2014-11-11 08:38:00 +01:00

20 lines
621 B
PHP

<?php
require 'vendor/autoload.php';
$updater = new \Kanti\HubUpdater(array(
"name" => 'kanti/test',//Repository to watch
"branch" => 'master',//wich branch to watch
"cache" => 'cache/',//were to put the caching stuff
"save" => 'save/',//there to put the downloaded Version[default ./]
"prerelease" => true,//accept prereleases?
));
if ($updater->able()) {
if (isset($_GET['update'])) {
$updater->update();
echo '<p>updated :)</p>';
} else {
echo '<a href="?update">Update Me</a>'; //only update if they klick this link
}
} else {
echo '<p>uptodate :)</p>';
}