On 2004-09-07, William McKee <[EMAIL PROTECTED]> wrote:
>
> Yes, it is easy to read the config file using Config::Auto. Lately, I've
> been working on making installers for my applications so that I can
> package and install them just like a CPAN module. Have you tried doing
> this?
I have thought about this, and agree that your approach seems
reasonable. Some people will have an web directory named "public_html".
Others will be named "www". Some will able to create a "perllib"
directory outside of the web root, others may need to dump everything in
/cgi-bin
It seems there is go way to hard-code even a relative "use lib" ahead of
time.
I like the idea of having installers, and I look forward to seeing what
you come with, especially since it integrates with Build.PL.
> This could become cumbersome if I had to process all of my instance
> scripts in order to declare the paths to the config file. I know that
> Config::Auto does some automatic searches, but it wouldn't find my config
> files which are in '[ProjectDir]/conf/*.conf'. Depending on where I call
> Config::Auto::parse(), I may need to use different relative paths which
> makes absolute paths more attractive. Any ideas would be appreciated.
What I have done in the past is to mention a relative config file path
in every instance script. It's true that some will have a slightly
different relative location.
This really hasn't been a time sink. I already have to edit each
instance script a bit anyway to change the package name. Possibly adding
another "../" to the confile file path is not a bit deal.
You've made a reasonable case for loading your config files in "setup()"
as well.
> I have an application that runs an entire website. It contains many
> instance scripts which all need access to some parts of the
> configuration. Having a separate config file for each instance script
> would add unnecessary redundancy. Calling the cfg_file() method would
> introduce the problems I describe above as well as add more code to my
> simple instance scripts. Putting the cfg_file() into setup simplifies
> configuring the system for all instance scripts.
I have created complex websites with lots of instance scripts, but using
one config file. I still put the path the config file in each instance
script.
> I think that both cases are valid and that simply rewording the text
> to explain that it can be used in both ways would be sufficient. I've
> attached a diff with my attempt at rewording (and a few minor mods).
That's fine. I'll accept this patch.
> This is a great example. Question: Where do you store your config files?
My site structure looks like this:
perllib/
www/
config/Config.pl
externals/ -- files not in CVS, like file uploads and cache data
There may also be:
sql/
test/ <- automated tests live here
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]