PHP code example of kanti / hub-updater

1. Go to this page and download the library: Download kanti/hub-updater library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kanti / hub-updater example snippets



ater = new \Kanti\HubUpdater('kanti/test');
$updater->update();



$settings = array(
	"settingsKey" => 'value',
);
new \Kanti\HubUpdater($settings);


ater = new \Kanti\HubUpdater(array(
    "cacheFile" => "downloadInfo.json",//name of the InformationCacheFile(in cacheDir)
    "holdTime" => 43200,//time(seconds) the Cached-Information will be used

    "versionFile" => "installedVersion.json",//name of the InstalledVersionInformation is safed(in cacheDir)
    "zipFile" => "tmpZipFile.zip",//name of the temporary zip file(in cacheDir)
    "updateignore" => ".updateignore",//name of the updateignore file(in root of project)

    "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?

    "exceptions" => true,//if true, will throw new \Exception on failure
));
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>';
}

bash
# Install Composer
curl -sS https://getcomposer.org/installer | php

.htaccess
favicon.ico
there/the/config.ini/is.ini