Revised proposal follows.
On 2005-12-20, Mark Stosberg <[EMAIL PROTECTED]> wrote:
>
> Here's the specific API proposal I have in mind:
>
> =head2 $self->config
>
> Returns a hashref containing application configuration details.
>
> The intended use is to load to read-only configuration details once
> from a config file at start up time.
>
> For applications that need little configuration, L<config()> is not
> necessary-- using C<PARAMS> in an instance script should suffice.
>
> Also, the C<param()> is the appropriate method to use to set a
> configuraiton value at run time.
>
> Typically C<config()> is overridden by a plugin which eases the process
> the parsing a configuration file. Configuration plugins that provide at
> least this basic API include:
>
> ...
>
> Please note that these plugins are free to provide to additional
> functionality beyond this.
>
=head2 $self->config
The intended use is to load to read-only configuration details once
from a config file at start up time.
This service is provided by plugins (list below). They must support at
at least this syntax:
my $value = $self->config('key');
By default, C<config()> simply returns undef, making it safe for other
plugins to directly to check if C<$self->config('key')> returns the
value it needs
For applications that need little configuration, L<config()> is not
necessary-- using C<PARAMS> in an instance script should suffice.
Also, the C<param()> is the appropriate method to use to set a
configuration value at run time.
Configuration plugins that provide at least this basic API include:
...
Please note that these plugins are free to provide to additional
functionality beyond this.
=cut
sub config { undef }
=head3 Standard config variables
Users are encouraged to use these standard config variable names, to
ease compatibility between plugins:
ROOT_URI - A URI corresponding to the project root (http://foo.com/proj )
ROOT_DIR - a file system path to the same location ( /home/joe/www/proj )
All-caps are used to denote that config variables are essentially global
constants.
Mark
PS: When did "URI" become the favored term over "URL"?
Still Confused about That in Indiana
--
--
. . . . . . . . . . . . . . . . . . . . . . . . . . .
Mark Stosberg Principal Developer
[EMAIL PROTECTED] Summersault, LLC
765-939-9301 ext 202 database driven websites
. . . . . http://www.summersault.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]