Guys in the thread below make a good point. Should we accept a multiline config and split it behind the scenes? Of course since we don't know whether there are new lines in it we will always need to split.

($r|$s)->add_config($multi_line_config);

if we do that I'm not sure whether we should drop the [EMAIL PROTECTED] argument, or may be keep it as an optimization and run no split on it if it's passed?

of course we could also add: add_config_multi() or something like that.

-------- Original Message --------
Subject: Re: [MP2] Setting up seperate logs for virtual hosts from a database
Date: Tue, 27 Jan 2004 15:36:34 -0800
From: Stas Bekman <[EMAIL PROTECTED]>
Organization: Hope, Humanized
To: Egor Shipovalov <[EMAIL PROTECTED]>
CC: 'Elizabeth Mattijsen' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
References: <[EMAIL PROTECTED]>

Egor Shipovalov wrote:
Can I add vhosts with $s->add_config? Something like:

  $s->add_config( "VirtualHost foo.com:80" );
  $s->add_config( "VirtualHost bar.com:80" );

and then do the loop with $s->next? Or am I now stretching the API beyond to what was intended?


I once was in your position and found httpd_conf a lot more convenient than
add_config. Just feed it the text you would normally write in httpd.conf:

foreach my $vhost (@vhosts) {
$s->httpd_conf(<<EOT
<VirtualHost $vhost{name}:80>
ErrorLog /var/log/httpd/$vhost{name}/error.log
...usual config stuff here... </VirtualHost>
EOT
);
}

$s->httpd_conf is not a mp2 API, you can use it only with Apache::compat.


Though I agree that requiring [EMAIL PROTECTED] and not allowing $lines ala mp1's
httpd_conf is silly, and we should support both.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to