Le lundi 03 février 2014 à 19:13 -0500, Perrin Harkins a écrit :
> On Mon, Feb 3, 2014 at 5:33 PM, Chris Bennett
> <ch...@bennettconstruction.us> wrote:
> > Right now I am using pg_1_.pl and pg_2.pl on the different hosts, but
> > the code is identical, except that some data is pulled in from a config
> > file for the different databases, etc used.

> I'm sure that you can use the same code, but the question is how do
> you know which data to pull in and how do you store it in perl data
> structures?  One common approach in this situation is to use
> PerlSetVar inside your virtualhost config to set something you can
> read from perl that will tell you which virtualhost you're in.  

Hi Perrin,

$r->hostname() will tell you which virtualhost you're in.


@Chris :

>
> Can I safely use pg.pl on both VirtualHosts or do I need to do
>something
> > else also to do this?
> 

I use this for the site that you see in my sig. 

legalcase.libremen.com (English version) shares the same code as 
litigios.libremen.com (Spanish version). Each virtualhost has its own
database, configured with PerSetVar, as Perrin said.

You can see it in action with the demo account.


-- 
                                        Regards, Vincent Veyron 

http://libremen.com/ 
Legal case, contract and insurance claim management software

Reply via email to