Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 50378 invoked from network); 21 Jul 2004 04:34:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 21 Jul 2004 04:34:51 -0000 Received: (qmail 82538 invoked by uid 500); 21 Jul 2004 04:34:49 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 82521 invoked by uid 500); 21 Jul 2004 04:34:49 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list embperl@perl.apache.org Delivered-To: moderator for embperl@perl.apache.org Received: (qmail 96572 invoked by uid 99); 20 Jul 2004 17:08:24 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Message-ID: <40FD51B5.6060701@dashing.com> Date: Tue, 20 Jul 2004 10:09:09 -0700 From: "John P. Gibbons" User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Andrew O'Brien" CC: Steve Wilder , embperl@perl.apache.org Subject: Re: Apache virtulahosts sharing modules References: <798980D8CEDD294AA08BFF4D506AA61B2706A3@mercury.OrielTech.Local> In-Reply-To: <798980D8CEDD294AA08BFF4D506AA61B2706A3@mercury.OrielTech.Local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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