perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r220299 - /perl/modperl/docs/trunk/src/docs/2.0/user/handlers/http.pod
Date Fri, 22 Jul 2005 11:44:52 GMT
Author: stas
Date: Fri Jul 22 04:44:49 2005
New Revision: 220299

URL: http://svn.apache.org/viewcvs?rev=220299&view=rev
Log:
use a more frequently used /~username namespace, rather than unusual /users/username one

Modified:
    perl/modperl/docs/trunk/src/docs/2.0/user/handlers/http.pod

Modified: perl/modperl/docs/trunk/src/docs/2.0/user/handlers/http.pod
URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/user/handlers/http.pod?rev=220299&r1=220298&r2=220299&view=diff
==============================================================================
--- perl/modperl/docs/trunk/src/docs/2.0/user/handlers/http.pod (original)
+++ perl/modperl/docs/trunk/src/docs/2.0/user/handlers/http.pod Fri Jul 22 04:44:49 2005
@@ -1327,8 +1327,8 @@
 
 Imagine a situation where you have to log requests into individual
 files, one per user. Assuming that all requests start with
-I</users/username/>, so it's easy to categorize requests by the second
-URI path component. Here is the log handler that does that:
+I</~username/>, so it's easy to categorize requests by the
+username. Here is the log handler that does that:
 
   #file:MyApache2/LogPerUser.pm
   #---------------------------
@@ -1348,7 +1348,7 @@
   sub handler {
       my $r = shift;
   
-      my($username) = $r->uri =~ m|^/users/([^/]+)|;
+      my($username) = $r->uri =~ m|^/~([^/]+)|;
       return Apache2::Const::DECLINED unless defined $username;
   
       my $entry = sprintf qq(%s [%s] "%s" %d %d\n),
@@ -1385,31 +1385,31 @@
 writing.
 
 To configure the handler simply enable the module with the
-C<PerlLogHandler> directive, inside the wanted section, which was
-I</users/> in our example:
+C<PerlLogHandler> directive, for the desired URI namespace (starting
+with : I</~> in our example):
 
-  <Location /users/>
+  <LocationMatch "^/~">
       SetHandler perl-script
       PerlResponseHandler ModPerl::Registry
       PerlLogHandler MyApache2::LogPerUser
       Options +ExecCGI
-  </Location>
+  </LocationMatch>
 
 After restarting the server and issuing requests to the following
 URIs:
 
-  http://localhost/users/stas/test.pl
-  http://localhost/users/eric/test.pl
-  http://localhost/users/stas/date.pl
+  http://localhost/~stas/test.pl
+  http://localhost/~eric/test.pl
+  http://localhost/~stas/date.pl
 
 The C<MyApache2::LogPerUser> handler will append to I<logs/stas.log>:
 
-  127.0.0.1 [Sat Aug 31 01:50:38 2002] "/users/stas/test.pl" 200 8
-  127.0.0.1 [Sat Aug 31 01:50:40 2002] "/users/stas/date.pl" 200 44
+  127.0.0.1 [Sat Aug 31 01:50:38 2002] "/~stas/test.pl" 200 8
+  127.0.0.1 [Sat Aug 31 01:50:40 2002] "/~stas/date.pl" 200 44
 
 and to I<logs/eric.log>:
 
-  127.0.0.1 [Sat Aug 31 01:50:39 2002] "/users/eric/test.pl" 200 8
+  127.0.0.1 [Sat Aug 31 01:50:39 2002] "/~eric/test.pl" 200 8
 
 It's important to notice that C<PerlLogHandler> can be configured for
 any subsection of the site, no matter whether it's served by a



---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Mime
View raw message