For the database side all I use is a constructor DATABASE_CONFIG(),
which checks whether or not the site is running on localhost. If it
is, I use the settings I've previously defined in the file (following
the same convention as the default setup).
I'm working on expanding my overall concept at this point - the sites
have become plugins, which gives me the separation of functionality
while allowing me to share some simple core functionality. I just need
to figure out a way to get Cake to route to the different plugins
based on the domain name. At this point I'm thinking this would be
something easiest done via AppController, maybe I could reuse the
component code. I'm just not sure yet how that works with routing.
I'll post my existing (now abandoned) code up in the bin later on, I
just need to get my head round this bit first.
Steve
On Apr 2, 10:28 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Another thing we use here is dirty hack includes in config files:
>
> This is my standard database.php file:
> <?php
> switch (strtolower($_SERVER['SERVER_NAME'])) {
> case 'site.local':
> case 'site':
> include APP . DS . 'config' . DS . 'database_local.php';
> break;
> case 'test.site.example.com':
> include APP . DS . 'config' . DS . 'database_test.php';
> break;
> default:
> include APP . DS . 'config' . DS . 'database_live.php';
> break;}
>
> ?>
>
> Which we use to save having to mess about with config on deployment. A
> similar solution would work for TWIOF's case, and may be the simplest
> option.
>
> Simonhttp://www.simonellistonball.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---