On 2005-12-20, Michael Graham <[EMAIL PROTECTED]> wrote:
>
> Before anyone gets too worried, I would like to point out that this
> proposal would not require a core change to C::A, but could be
> implemented with a plugin using the existing plugin system.

It be a plugin, but I think the definition of a standard API for this
belongs in the core. Since we are talking about a single (5 line? )
optional method, I think it's reasonable to add there.  It can still be 
ignored or overridden if you choose. 

>     * need a clean way of dealing with config formats that don't support
>       hierarchical data structures.

I see that happening like this: The session plugin declares: 

"You can configure me through your config file if you use one of the
plugins that is powerful enough to support hierarchical data structures. 
Otherwise, configure me manually."

In other words, if you want to stick with a less powerful config file
system, you aren't any worse off than you are now. 

>     * plugins that want a database handle should be encouraged to look
>       to $self->dbh before they get their connection info from the
>       config file.

Agreed. Also, supporting sub { $self->dbh } is nice when people /do/ use
the explicit config interface. This keeps the handle from actually being  
created until it is needed, if at all. 

>     * Any other computed config values that plugins typically need?

Not that I can think of. 

>     * It might be reasonable to allow multiple config 'providers'.  For
>       instance having a 'root_dir' param available that all plugins can
>       rely on could be a really useful thing.

Agreed. 

>       But if the app is running under PAR, then maybe 'root_dir' is in
>       some magical faraway place under $ENV{'PAR_TMP'}, and maybe the
>       exact directory name isn't known until runtime.  In this case, the
>       system could allow the PAR plugin to override this single
>       parameter only.

I want CGI::Apps to eventually have something like 'mark par'. Part of
'mark par' conuld involve altering the configuration to adjust this.
Exactly how...I'll leave to someone else.

( Catalyst may have code to reference for this. )

    Mark

-- 
http://mark.stosberg.com/ 


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

Reply via email to