cholet 01/12/28 02:25:48
Modified: Apache Apache.pm
Log:
more docco
Revision Changes Path
1.66 +23 -7 modperl/Apache/Apache.pm
Index: Apache.pm
===================================================================
RCS file: /home/cvs/modperl/Apache/Apache.pm,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- Apache.pm 2001/12/27 15:44:33 1.65
+++ Apache.pm 2001/12/28 10:25:48 1.66
@@ -650,15 +650,29 @@
authentication realm, from C<$r-E<gt>auth_name>, to determine which set of
credentials to authenticate.
-=item $r->document_root
+=item $r->document_root ( [$docroot] )
-Returns a reference to the current value of the per server
-configuration directive B<DocumentRoot>. To quote the Apache server
-documentation, "Unless matched by a directive like Alias, the server
-appends the path from the requested URL to the document root to make
-the path to the document." This same value is passed to CGI
+When called with no argument, returns a reference to the current value
+of the per server configuration directive B<DocumentRoot>. To quote the
+Apache server documentation, "Unless matched by a directive like Alias,
+the server appends the path from the requested URL to the document root
+to make the path to the document." This same value is passed to CGI
scripts in the C<DOCUMENT_ROOT> environment variable.
+You can also set this value by providing an argument to it. The following
+example dynamically sets the document root based on the request's
+"Host:" header:
+
+ sub trans_handler
+ {
+ my $r = shift;
+ my ($user) = ($r->header_in('Host') =~ /^[^\.]+/);
+ $r->document_root("/home/$user/www");
+ return DECLINED;
+ }
+
+ PerlTransHandler trans_handler
+
=item $r->allow_options
The C<$r-E<gt>allow_options> method can be used for
@@ -960,7 +974,9 @@
=item $r->no_cache( $boolean )
This is a flag that indicates that the data being returned is volatile
-and the client should be told not to cache it.
+and the client should be told not to cache it. C<$r-E<gt>no_cache(1)>
+adds the headers "Pragma: no-cache" and "Cache-control: no-cache" to
+the reponse, therefore it must be called before C<$r-E<gt>send_http_header>.
=item $r->print( @list )