PHP code example of herrera-io / service-update
1. Go to this page and download the library: Download herrera-io/service-update 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/ */
herrera-io / service-update example snippets
use Herrera\Service\Container;
use Herrera\Service\Update\UpdateServiceProvider;
$container = new Container();
$container->register(new UpdateServiceProvider(), array(
'update.url' => 'https://example.com/manifest.json'
));
/** @var $manager Herrera\Phar\Update\Manager */
$manager = $container['update.manager'];
/** @var $manifest Herrera\Phar\Update\Manifest */
$manifest = $container['update.manifest'];
/**
* Updates the running Phar.
*
* @param string $version The current version.
* @param boolean $major Lock to current major version?
* @param boolean $pre Allow updates to pre-releases?
*/
$callable = $container['update'];