I'm building a small cms and i would like to make a self update feature to it. (something like WordPress has done, but to be honest, i don't know how that works)
So here is where i am now:
- Every time the client logs in, a curl post request is going to my server, sending the current version of the cms, some authentication data, and for now that's all.
- A response comes back, and it there is a new version i get the full description about it, show it in the front end to the client and if he wants to update, i download a zip file.
This is where i'm stuck. I don't know if this is the good way and even it it is, how should i proceed.
- After download i would like to unpack it, overwrite the old files with the new one's, and make all the changes necessary, maybe do some migrations and so on.
- Make some logs, backups, and when all its done somehow check to so if everything is ok. (Don't know if that's possible)
So could please someone give me some directions, ideas, any advice would be gratefully appreciated.