00f100 / phpuphar
Library to self update your phar file
Installs: 376
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/00f100/phpuphar
Requires
- php: >=5.5
- guzzlehttp/guzzle: 6.*
Requires (Dev)
This package is auto-updated.
Last update: 2025-10-18 08:23:35 UTC
README
Library to self update your Phar package
Installation
$ composer require 00f100/phpuphar
or add in your composer.json
"require": {
"00f100/phpuphar": "*"
},
Usage
# 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 ... }