Tuesday, June 30, 2009

Re: Web Installer

I wrote a web installer for a CakePHP CMS, but I took the quick way
out: I didn't actually write it as part of Cake, just as a standalone
install script. It took me all of 5 minutes this way. Here's what it
does:

- Asks the user for database parameters (dbname, user, pass)
- Copies a zip file from a central place on the server containing the /
app directory and the root index.php and .htaccess (the core Cake
files are shared between many different sites so they're in a
different place)
- Unzips the zip file
- Opens up app/config/database.php with fopen and replaces DB
placeholders (%dbuser%, %dbpass%, %dbname%) with the info from the
install form
- Deletes the zip file and install script

And that's it! Cake is up and running. It also does sanity checks at
each step to make sure nothing crazy happens. But basically, I thought
that a standalone install script would be much faster to write (I was
right), and, more importantly, it would make installing the CMS easier
for the non-programmers (i.e. designers) in our company.

Hope that helps...

- Jamie

On Jun 29, 5:13 pm, aarkerio <mmont...@gmail.com> wrote:
> Hi! I am trying to code a Web Installer for my APP. The installer show
> a form with typical fields: database_name, user, password, etc. This
> information will be used to create database.php file so
> "installers_controller.php" must run without database configuration,
> ¿there is a way to do this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: