Re: domain cross talk...?

[prev] [thread] [next] [Date index for 2004/10/06]

From: Michael Jensen
Subject: Re: domain cross talk...?
Date: 16:16 on 06 Oct 2004
FYI, the AcuText::ClassDBI reference in my code examples is supposed to 
correlate with the package Site2::ClassDBI, so disregard that 
inaccuracy as it is correct in my code.

Sorry.

-Michael

On Oct 6, 2004, at 11:03 AM, Michael Jensen wrote:

> Yes I am using mod_perl. Here are two examples of different .pm files:
>
>
> package Site2::ClassDBI;
>
> use strict;
> use warnings;
> use base 'Class::DBI';
>
> my $dsn         = 'dbi:mysql:database=somedb;host=somehost.net';
> my $username    = 'someuser';
> my $password    = 'somepass';
>
> AcuText::ClassDBI->set_db(Main => $dsn, $username, $password);
>
> package Table::Users;
>
> use base 'Site2::ClassDBI';
>
> Table::Users->table('users');
> Table::Users->columns(Primary => qw/id/);
> Table::Users->columns(Others => qw/username password group_id 
> create_date edit_date first_name last_name company_id email phone fax 
> plan_type plan_limit last_login_date msg_email address city state zip 
> training/);
> Table::Users->has_a(group_id=>'Table::Groups');
> Table::Users->has_a(company_id=>'Table::Companies');
> Table::Users->add_trigger(before_create => sub { use Time::Format 
> qw(%time %strftime %manip); $_[0]->set(create_date => 
> $time{'yyyy-mm-dd hh:mm:ss'}) });
> 1;
>
>
>
>
>
>
> package Site3::ClassDBI;
>
> use strict;
> use warnings;
> use base 'Class::DBI';
>
> my $dsn         = 'dbi:mysql:database=somedb;host=somehost.net';
> my $username    = 'someuser';
> my $password    = 'somepass';
>
> AcuText::ClassDBI->set_db(Main => $dsn, $username, $password);
>
> package Table::Users;
>
> use base 'Site3::ClassDBI';
>
> Table::Users->table('users');
> Table::Users->columns(Primary => qw/id/);
> Table::Users->columns(Others => qw/username password group_id 
> create_date edit_date first_name last_name company_id email phone_1 
> phone_2 last_login_date address city state zip/);
> Table::Users->has_a(group_id=>'Table::Groups');
> Table::Users->has_a(company_id=>'Table::Companies');
> Table::Users->add_trigger(before_create => sub { use Time::Format 
> qw(%time %strftime %manip); $_[0]->set(create_date => 
> $time{'yyyy-mm-dd hh:mm:ss'}) });
> 1;
>
>
> So I do have some of the same things, Table::Users, Table::Messages, 
> Table::Groups, etc. But I have some of the same (at least users) with 
> the first and second site. In my code I reference them like this:
>
>
> use lib "/home/webtree/home/www.site2domain.com/html/o";
> use Site2::ClassDBI;
>
> or
>
> use lib "/home/webtree/home/www.site3domain.com/html/o";
> use Site3::ClassDBI;
>
>
>
> Is doing it this way a problem?
>
> -Michael
>
>
>
>
> On Oct 6, 2004, at 9:47 AM, Perrin Harkins wrote:
>
>> On Wed, 2004-10-06 at 08:47, Michael Jensen wrote:
>>> I have 3 sites I now use CDBI with. Upon adding the 2nd site I had no
>>> issue between the two sites. Now I have a third and I copied
>>> everything from the 2nd site to the original site as a starting
>>> point,including my code for CDBI stuff, but then made the changes for
>>> the3rd site.
>>
>> Are you running under mod_perl?  Do you have multiple Class::DBI 
>> classes
>> with the same name?  That won't work.  There is class data that will 
>> get
>> overwritten.
>>
>> - Perrin
>>
>
>


(message missing)

domain cross talk...?
Michael Jensen 06:47 on 06 Oct 2004

Re: domain cross talk...?
William McKee 14:41 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 14:47 on 06 Oct 2004

Re: domain cross talk...?
William McKee 14:51 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 15:06 on 06 Oct 2004

Re: domain cross talk...?
William McKee 15:32 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 15:36 on 06 Oct 2004

Re: domain cross talk...?
Michael Jensen 16:03 on 06 Oct 2004

Re: domain cross talk...?
Michael Jensen 16:16 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 16:27 on 06 Oct 2004

Re: domain cross talk...?
Carl Johnstone 23:17 on 06 Oct 2004

Re: domain cross talk...?
William McKee 15:53 on 06 Oct 2004

Re: domain cross talk...?
merlyn (Randal L. Schwartz) 16:17 on 06 Oct 2004

Re: domain cross talk...?
Perrin Harkins 16:31 on 06 Oct 2004

[CDBI] Class::DBI::Loader question
Peter Speltz 00:31 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Kingsley Kerce 02:57 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Perrin Harkins 04:12 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Kingsley Kerce 18:43 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Clayton L. Scott 17:08 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Peter Speltz 17:32 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Perrin Harkins 18:58 on 12 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Kingsley Kerce 14:26 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Perrin Harkins 15:17 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Tony Bowden 15:39 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Kingsley Kerce 14:26 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
Tim Bunce 16:22 on 14 Oct 2004

Re: [CDBI] Class::DBI::Loader question
merlyn (Randal L. Schwartz) 17:24 on 14 Oct 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52