views:

344

answers:

3

I'm building a self-hosted web app using CodeIgniter and I need a nice GUI-ified installer which will present the user with a form for database info, validate and test the info, write that info to the database.php config file, and then set up the DB structure.

Any tips for this? Should it be inside of CodeIgniter (as a Controller perhaps) or should it be its own thing (perhaps an 'install' folder which would be a sibling of 'application' and 'system')? Any projects I could look at for inspiration?

Obviously it's not a hard task but I just didn't want to reinvent the wheel so I thought I'd ask first.

A: 

It would be a much more integrated experience to have the settings page be within the web application.

However, you'll have to make sure that settings don't render the application unusable, since the user would then be locked out of making further changes.

This also has the added benefit of not having any further software requirements. If you build a native GUI, extra libraries would likely be needed.

Ben S
I'm just following the lead of every other CMS or self-hosted app out there which asks you for DB info at first, writes it to a file, and then you're done with it. I don't see the point of changing from that paradigm in this specific case.
Mike Crittenden
A: 

I have an application that I am writing that will sit most of the CodeIgniter code outside the web directory. When the user downloads my code, they will need to extract it, then run either a bash or vbscript to set it up. There is no way of doing this from inside a web page that I can think of.

User downloads code.

User extracts code to temp directory.

User runs setup script (as root / administrator).

Script moves sections of code to appropriate places on the file system.

Script asks for credentials (DB, etc) and inserts them into appropriate file(s).

Script chmod's files and directories to appropriate permissions (some need write, some do not).

Is there any way to do this inside a webpage ?

Mark Unwin
A: 

I ended up using a pre_controller hook to do the check and redirect if necessary.

Mike Crittenden