perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John P. Gibbons" <j...@dashing.com>
Subject Re: Apache virtulahosts sharing modules
Date Tue, 20 Jul 2004 17:09:09 GMT
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?

John

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message