Updating php application from external server

I am writing a small application as part of KohanaPHP. Suppose this application will have some updates in the future. The current version, for example, v1.0.

What is the best and best way:

  • check if there is any new version
  • and if so, update the files on the current server from the remote server

So far, I use cURL to get the version.txt form file in the remote file, and then compare it with a constant variable in the application engine. Then I use the https://github.com/kanema/kohana-ftp module to connect to the server and the updating application.

Is there a better solution, especially when checking for updates (this is a bit annoying with the .txt version and takes some time).

+3
source share
2 answers
  • Use some version control system , such as Git.
  • Use some upgrade scripts, scripts to check if the current version (production version) is the same as in the remote repository (the latest, updated when you make changes) and - if the versions are different - update the production.
  • Call the script from point 2. on an ongoing basis, for example, using cron.

This will be the fastest (based on Git internal mechanisms) solution, very reliable (you will use the version control system) and quite safe (you will not overwrite, for example, files uploaded by users).

There are several examples of such tools on the Internet.

Git cron : fooobar.com/questions/118583/... p >

" ", , -, push ( , , GitHub).

+2

. / Linux (,.deb Debian) , /.

0

All Articles