Arc
Arc

Reputation: 11286

Update Framework for PHP

Does anyone know of a framework (written in PHP) to update PHP-based software ?

I'm thinking of a library that assists in checking for updates online and that provides methods for generating, downloading, verifying and installing update packages, maybe even with encryption and public-key signatures.

Ideally with a non-copyleft open source license (e.g. BSD or MIT License, no GPL).

While source control tools are nice in theory, they can complicate (initial) deployment of PHP applications as they are not PHP-based (limits portability) and are often quite large.

Upvotes: 3

Views: 929

Answers (2)

Arc
Arc

Reputation: 11286

I've developed my own solution now which provides functions for generating, verifying and installing update packages.

Basically, it uses PHP's OpenSSL functions for public-key encryption (RSA) of the key for symmetric encryption, mcrypt for symmetric encryption (AES) and ZIP as the container format. These building blocks are used to create compact update packages and ensure data integrity and authenticity.

One could also use openssl_pkcs7_sign() and openssl_pkcs7_encrypt() and their counterparts for MIME-compliant encryption, however these functions seem to use 7-bit encoding and therefore make archives rather large.

The web application must have all its files and system-independent data in a single application directory that can be replaced to upgrade the application.

Updating is performed as follows:

Extracting the ZIP archive contents to a temporary location

  • Execute a pre-update script
  • Move the new application directory to the proper place using a temporary name
  • Move the old application directory to another place or rename it
  • Rename the new application directory to its expected name
  • Run a post-update script
  • If anything goes wrong, try to roll back -

Version / source control systems such as git are nice when you are the one in control of all target systems but otherwise I think you should not require the customer to install and operate third-party software for which you would have to provide support as well but rather provide a user interface for software updates that integrates well with the rest of your software.

Upvotes: 3

Julius F
Julius F

Reputation: 3444

What about a software that uses the source control tool, like git to check for new updates and loads the newest commit?

Upvotes: 1

Related Questions