Download the PHP package parkerj/php-auto-update without Composer
On this page you can find all versions of the php package parkerj/php-auto-update. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-auto-update
With this library your users can automatically update their instance of your application to the newest version. I created it as a proof of concept and don't know if it is used somewhere. So please use this library with caution because it can potentially make your users software nonfunctional if something goes wrong.
Installation
- Install the library via composer parkerj/php-auto-update
- Create a update file/method in your application with your update routine (see
example/client/update/index.php
) - Create a
update.json
orupdate.ini
on your server (where the client should get the updates, seeexample/server/update.json
orexample/server/update.ini
)
Important: Please notice that PHP needs write permissions to update the files on the webserver
Example
Client
update.php/some method
This file will install the update. For an example see example/client/update/index.php
Check for new versions
You can always check for new versions, e.g. in the footer. This can look like this:
The library supports the desarrolla2/cache
component and you should use it! Otherwise the client will download the update ini/json file on every request.
Server
Your server needs at least one file which will be downloaded from the client to check for updates. This can be a json or an ini file. See example/server/
for examples. The ini section key respectively the json key is the version. This library uses semantic versioning to compare the versions. See semver.org for details. The ini/json value is the absolute url to the update zip file. Since the library supports incremental updates, the zip file only need to contain the changes since the last version. The zip files do not need to be placed on the same server, they can be uploaded to S3 or another cloud storage, too.
Documentation
For the documentation see the comments in src/AutoUpdate.php
or the example in the example
directory.
All versions of php-auto-update with dependencies
monolog/monolog Version ^1.2
php Version >= 5.6.4
vierbergenlars/php-semver Version ^3.0