perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew O'Brien" <Andrew.O'>
Subject RE: Apache virtulahosts sharing modules
Date Wed, 21 Jul 2004 02:05:46 GMT

> From: John P. Gibbons [] 
> Subject: Re: Apache virtulahosts sharing modules
> Andrew O'Brien wrote:
> >Your best bet is to have site-specific information set up at 
> the embperl
> >request level. Ie have constants/whatever initialised in base files
> >rather than having that kind of logic in the modules.
> >  
> >
> Andrew,
>   Will it work if you have your perl module require a file 
> filled with 
> constants for each site? What I've been doing is my module determines 
> the current site via $ENV{DOCUMENT_ROOT} and I then construct the 
> correct path to the unique config file for each site. I then 
> "require" 
> that file in my module. This works for me, but right now I am only 
> testing this with one VirtualHost so I don't know if there 
> will be any 
> issues. If not, this might be a good way to do it. I didn't 
> want to have 
> an Embperl specific include because I also have regular perl programs 
> that run as cron jobs and I want them to also get access to those 
> constants too. I just feed them the site name from the command line 
> since they have no access to the Apache ENV variables, but 
> the result is 
> the same.
>   Thoughts on this technique?

I would have done it with a config table that all scripts/website etc
have access to. That way the only thing that you need to know is what
site you're dealing with and how to connect to the database. Same thing,
in effect.

As the scripts have different paths you're not going to have compilation
caching issues so I *think* you'll be all good. I still can't shake the
feeling I'm missing something obvious here though :)



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message