tags:

views:

284

answers:

3

I'm looking to create a fully functional installer for a slightly complicated web application using PHP. Basically, you go to URL/setup.php and you are asked a series of questions, and during the process a database is set up and a config file is populated according to the answers given. A good example of this is how Wordpress handles its install procedure, as well as any number of PHP applications.

My question to you, oh great internet, is this: This technique is so prevalent that surely not everyone is re-inventing the wheel, is there a place I can go to find a basic walkthrough (not code, just a description) of the technique. Either that or a good book which outlines if not this specific technique, then the fundamentals relevant to this?

I can bang out something ugly and probably make it work myself, but if there's a best known method I'd like to find it.

Far more important than having a working function is to have a description of what's going on from step to step. I'd like to have the installer, but I really want to learn how it's done.

Thanks, Mike

A: 

I would strongly recommend just copyomg the installer from the program you like the most. As I started reading your question, the first one to pop to mind was Wordpress. Then I saw your mention :-) You are on the right track.

Another two good ones to copy are: SilverStripe and OpenX.

drudru
+2  A: 

I've made my own installer script and here are my tips.

  1. Make sure to validate that the script will run (file & db permissions)
  2. Make sure the folders/files/db structure isn't already present (if the script has run before)
  3. If that's the case, make sure to have an option to remove these files
  4. Always keep in mind that the user/script can fail everywhere and it should always be possible to start over
Emil
A: 

I was looking for the same thing the other day, a script that can "install" your system. I know you are not looking for code, but I found one on CodeCanyon.net named PHP Setup Wizard. It works for me :)

Bjossi