[development] Patching settings.php

Khalid B kb at 2bits.com
Fri Aug 4 00:24:02 UTC 2006


On 8/3/06, Jeff Eaton <jeff at viapositiva.net> wrote:
> Well, it's easy enough to auto-detect the current hostname. The question
> is whether it should be stored in sites/default, sites/www.example.com,
> sites/example.com... And so on and so on.

Drupal (at least 4.7) handles the incoming host as the base_url.

>From this code  in bootstrap.inc:

    $base_root = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ==
'on') ? 'https' : 'http';
    $base_url = $base_root .= '://'. $_SERVER['HTTP_HOST'];

Althought this allows you to skip the base_url part, it has its own issues
though, things that rely on $base_url will get more than one of them.

For example, the referrers report under admin/logs will be screwed up,
and will show www as being external referrals, or the other way around.

The www vs plain can be solved by a symbolic link from one to the
other.

> I, for one, absolutely despise urls that don't have 'www' at the
> beginning -- the http://example.com style. It jst bugs me. I'd loathe
> having drupal default my sites to that style, but explaining the
> subtleties of how to specify your domain name makes things tricky.

I feel the opposite. The www prefix is redundant ...
But that is a religious argument ...

> I *lean* towards the idea of installing in sites/default, and allowing
> users to create their own sites directories with an unmodified
> default-settings.php file. Sifting through the tricky bits of
> intelligently picking the right directory (or helping the user to) is...
> A complicated beast, I think.
>
> But then, I could be wrong -- it might not be as complicated as I fear.
>
> --Jeff
>
> -----Original Message-----
> From: Rowan Kerr [mailto:rowan at stasis.org]
> Sent: Thursday, August 03, 2006 7:03 PM
> To: development at drupal.org
> Subject: Re: [development] Patching settings.php
>
>
> Gerhard Killesreiter wrote:
> > The problem is that the installer writes to the file in
> > default/settings.php. The installer should create an appropriate
> > subdiretory /mydomain and then copy the settings.php file there and
> > write to the copy.
>
> So we'll need another option in the installer to specify the hostname of
>
> the site being installed, yeah?
>
> -Rowan
>
>
>
>
>
>
>
>


More information about the development mailing list