Javid Karimov
Javid Karimov

Reputation: 455

php auto update script files

How can I create script version update function like in datalife engine cms ? For example customer has version 1.0 and I have created version 1.5. And I want the user to be able to update the script version directly from admin panel. How can I do it ?

Upvotes: 0

Views: 5705

Answers (2)

Travis Pessetto
Travis Pessetto

Reputation: 3298

Notice: This is my own solution.

@Guilherme Soster has provided the basics on how to do it. However if you do not want to do it yourself you can check my php-updater solution. You can define what you want to add (overwrite or add) and delete as well as scripts you want to run in a YAML file.

Upvotes: 1

Guilherme Soster
Guilherme Soster

Reputation: 74

well, basically you'll have to store the user system's version in some config file or database and have a server where you keep the latest version of your scripts. Then when the user request to check for updates (or each time that the software runs) your update script should hit the server and get the latest version number, compare it with the one your user has stored and if the user one is inferior the script should download the new scripts from the server (usually to a temp directory). Now all that the update script has to do is remove the old scripts and move the new ones to the directories where they belong. Finally the update script should update the version in the confi file/database.

Upvotes: 1

Related Questions