PHP code example of 00f100 / phpuphar

1. Go to this page and download the library: Download 00f100/phpuphar 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/ */

    

00f100 / phpuphar example snippets


# Url to view current VERSION in GIT
$urlUpdate = array(
	'base' => 'https://example.com',
	'path' => '/path/to/version',
);

# Version current
$version = '1.0.0';

# Url to download Phar file
$urlDownloadPhar = 'https://github.com/00F100/phpatr/raw/master/dist/phpatr.phar';

# Name of phar file
$namePhar = 'example.phar';

# New instance of PHPUPhar
use PHPUPhar\PHPUPhar;
$selfUpdate = new PHPUPhar($urlUpdate, false, $version, $urlDownloadPhar, $namePhar);

# Test number of version
if ($version != $selfUpdate->getVersion() && $selfUpdate->update()) {
    # Your version has updated ...
}