You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2002/09/05 03:49:32 UTC
cvs commit: modperl-2.0/t/conf modperl_extra.pl
dougm 2002/09/04 18:49:32
Modified: t/conf modperl_extra.pl
Log:
test $r->add_config
Revision Changes Path
1.19 +14 -5 modperl-2.0/t/conf/modperl_extra.pl
Index: modperl_extra.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- modperl_extra.pl 24 Aug 2002 16:33:15 -0000 1.18
+++ modperl_extra.pl 5 Sep 2002 01:49:32 -0000 1.19
@@ -62,6 +62,16 @@
return $buf;
}
+sub ModPerl::Test::add_config {
+ my $r = shift;
+
+ #test adding config at request time
+ my $errmsg = $r->add_config(['require valid-user']);
+ die $errmsg if $errmsg;
+
+ Apache::OK;
+}
+
#<Perl handler=ModPerl::Test::perl_section>
# ...
#</Perl>
@@ -77,23 +87,22 @@
## a real handler would do something like:
# eval "package $package; $code";
# die $@ if $@;
-## feed %Apache::ReadConfig:: to Apache::Directive->insert
+## feed %Apache::ReadConfig:: to Apache::Server->add_config
my $htdocs = Apache::server_root_relative($parms->pool, 'htdocs');
my @cfg = (
"Alias /perl_sections $htdocs",
"<Location /perl_sections>",
- " require valid-user",
+# " require valid-user",
+ " PerlInitHandler ModPerl::Test::add_config",
" AuthType Basic",
" AuthName PerlSection",
" PerlAuthenHandler TestHooks::authen",
"</Location>",
);
- my $errmsg = Apache::Directive->insert($parms->server,
- $parms->pool,
- \@cfg);
+ my $errmsg = $parms->server->add_config(\@cfg);
die $errmsg if $errmsg;