[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] positional plugin ordering


Rhesa Rozendaal wrote:
> Michael Peters wrote:
> 
>>   # now inside of my dbh plugin
>>   $self->add_callback(
>>     after_config => \&_setup_dbh
>>   );
>>
>> Then my base class can simply:
>>
>>   use C::A::P::MyConfig;
>>   use C::A::P::MyDBH;
> 
> 
> Minor detail: what would happen if I'm only interested in your CAP-MyDBH?
> Looks to me it'd never get to _setup_dbh() then.

I thought of this, but didn't want to actually face the answer :)

> I suppose we also need an is_hook_available($hookname) method :)

Yeah, I thought of that too. Then the CAP::MyDBH plugin could look for
the config hook if it's available, else pick something else appropriately.

if( $self->is_hook_available('after_config') ) {
  $self->add_callback( after_config => \&_setup_dbh );
} else {
  $self->add_callback( intit => \&_setup_dbh );
}

-- 
Michael Peters
Developer
Plus Three, LP


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.