views:

95

answers:

2

Hi all,

I'm building a CMS application in PHP.

  1. How can I make it update itself? For example via a zip file or something similar. So that an user can see new releases and download / install them without using a FTP program at all.

  2. What's the best way to protect my application? So that the user can't share it with friends. I know that a 100% waterproof protection is impossible.

Thanks!

A: 
  1. That feature is present in Wordpress. You can check out wordpress.org, download the source and understand how it's implemented.

  2. You have this commercial tool.

rogeriopvl
+1  A: 

1 . Create php script that:

  • reads current application version number from version file and posts it to central repository. Repository should return responce indicating there is or there is no newer version (you can use cURL function to implement the post)
  • using ftp functions downloads update package
  • disables current application (by putting some "maintenance" page)
  • extracts updated version and writes on top of old
  • runs update script that came with new update. This script should do DB updates, configuration or take other actions depending on what have changed
  • updates version number in version file
  • enables application

Put that script in crontab file to run periodicaly

2 . You could use Zend Guard tools, but it costs.