perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject svn commit: r159848 [2/2] - in perl/modperl/docs/trunk/src/docs/2.0/user/handlers: filters.pod http.pod intro.pod protocols.pod server.pod
Date Sat, 02 Apr 2005 23:32:22 GMT
Modified: perl/modperl/docs/trunk/src/docs/2.0/user/handlers/protocols.pod
URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/user/handlers/protocols.pod?view=diff&r1=159847&r2=159848
==============================================================================
--- perl/modperl/docs/trunk/src/docs/2.0/user/handlers/protocols.pod (original)
+++ perl/modperl/docs/trunk/src/docs/2.0/user/handlers/protocols.pod Sat Apr  2 15:32:19 2005
@@ -60,7 +60,7 @@
 connection that is being used.  mod_perl itself uses this phase to
 register the connection input and output filters.
 
-In mod_perl 1.0 during code development C<Apache::Reload> was used to
+In mod_perl 1.0 during code development C<Apache2::Reload> was used to
 automatically reload modified since the last request Perl modules. It
 was invoked during C<post_read_request>, the first HTTP request's
 phase. In mod_perl 2.0 I<pre_connection> is the earliest phase, so if
@@ -70,7 +70,7 @@
 
   PerlInterpScope connection
 
-and invoke the C<Apache::Reload> handler during the I<pre_connection>
+and invoke the C<Apache2::Reload> handler during the I<pre_connection>
 phase. However this development-time advantage can become a
 disadvantage in production--for example if a connection, handled by
 HTTP protocol, is configured as C<KeepAlive> and there are several
@@ -91,7 +91,7 @@
   sub handler {
       my $c = shift;
       # ...
-      return Apache::OK;
+      return Apache2::OK;
   }
 
 [META: There is another argument passed (the actual client socket), but
@@ -102,40 +102,40 @@
 consumed. This is almost as good as a firewall blocking, as it's
 executed before Apache has started to do any work at all.
 
-C<MyApache::BlockIP2> retrieves client's remote IP and looks it up in
+C<MyApache2::BlockIP2> retrieves client's remote IP and looks it up in
 the black list (which should certainly live outside the code, e.g. dbm
 file, but a hardcoded list is good enough for our example).
 
-  #file:MyApache/BlockIP2.pm
+  #file:MyApache2/BlockIP2.pm
   #-------------------------
-  package MyApache::BlockIP2;
+  package MyApache2::BlockIP2;
   
   use strict;
   use warnings;
   
-  use Apache::Connection ();
+  use Apache2::Connection ();
   
-  use Apache::Const -compile => qw(FORBIDDEN OK);
+  use Apache2::Const -compile => qw(FORBIDDEN OK);
   
   my %bad_ips = map {$_ => 1} qw(127.0.0.1 10.0.0.4);
   
   sub handler {
-      my Apache::Connection $c = shift;
+      my Apache2::Connection $c = shift;
   
       my $ip = $c->remote_ip;
       if (exists $bad_ips{$ip}) {
           warn "IP $ip is blocked\n";
-          return Apache::FORBIDDEN;
+          return Apache2::FORBIDDEN;
       }
   
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   1;
 
 This all happens during the I<pre_connection> phase:
 
-  PerlPreConnectionHandler MyApache::BlockIP2
+  PerlPreConnectionHandler MyApache2::BlockIP2
 
 If a client connects from a blacklisted IP, Apache will simply abort
 the connection without sending any reply to the client, and move on to
@@ -168,7 +168,7 @@
       my $sock = $c->client_socket;
       $sock->opt_set(APR::SO_NONBLOCK, 0);
       # ...
-      return Apache::OK;
+      return Apache2::OK;
   }
 
 Most likely you'll need to set the socket to perform blocking IO. On
@@ -189,7 +189,7 @@
 =head3 Socket-based Protocol Module
 
 To demonstrate the workings of a protocol module, we'll take a look at
-the C<MyApache::EchoSocket> module, which simply echoes the data read
+the C<MyApache2::EchoSocket> module, which simply echoes the data read
 back to the client. In this module we will use the implementation that
 works directly with the connection socket and therefore bypasses
 connection filters if any.
@@ -201,11 +201,11 @@
 
   Listen 8010
   <VirtualHost _default_:8010>
-      PerlModule                   MyApache::EchoSocket
-      PerlProcessConnectionHandler MyApache::EchoSocket
+      PerlModule                   MyApache2::EchoSocket
+      PerlProcessConnectionHandler MyApache2::EchoSocket
   </VirtualHost>
 
-C<MyApache::EchoSocket> is then enabled when starting Apache:
+C<MyApache2::EchoSocket> is then enabled when starting Apache:
 
   panic% httpd
 
@@ -225,17 +225,17 @@
 
 Here is the code:
 
-  file:MyApache/EchoSocket.pm
+  file:MyApache2/EchoSocket.pm
   ---------------------------
-  package MyApache::EchoSocket;
+  package MyApache2::EchoSocket;
   
   use strict;
   use warnings FATAL => 'all';
   
-  use Apache::Connection ();
+  use Apache2::Connection ();
   use APR::Socket ();
   
-  use Apache::Const -compile => 'OK';
+  use Apache2::Const -compile => 'OK';
   use APR::Const    -compile => 'SO_NONBLOCK';
   
   use constant BUFF_LEN => 1024;
@@ -252,7 +252,7 @@
           $sock->send($buff);
       }
   
-      Apache::OK;
+      Apache2::OK;
   }
   1;
 
@@ -260,8 +260,8 @@
 and of course, C<use strict;>.  As with all C<Perl*Handler>s, the
 subroutine name defaults to I<handler>.  However, in the case of a
 protocol handler, the first argument is not a C<request_rec>, but a
-C<conn_rec> blessed into the C<Apache::Connection> class.  We have
-direct access to the client socket via C<Apache::Connection>'s
+C<conn_rec> blessed into the C<Apache2::Connection> class.  We have
+direct access to the client socket via C<Apache2::Connection>'s
 I<client_socket> method.  This returns an object, blessed into the
 C<APR::Socket> class. Before using the socket, we make sure that it's
 set to perform blocking IO, by using the C<APR::SO_NONBLOCK> constant,
@@ -275,7 +275,7 @@
 
 If the handler receives some data, it sends it unmodified back to the
 client with the C<APR::Socket::send()> method. When the loop is
-finished the handler returns C<Apache::OK>, telling Apache to
+finished the handler returns C<Apache2::OK>, telling Apache to
 terminate the connection. As mentioned earlier since this handler is
 working directly with the connection socket, no filters can be
 applied.
@@ -290,14 +290,14 @@
 their lowercase equivalents.
 
 The following configuration defines a virtual host listening on port
-8011 and which enables the C<MyApache::EchoBB> connection handler, which
-will run its output through C<MyApache::EchoBB::lowercase_filter> filter:
+8011 and which enables the C<MyApache2::EchoBB> connection handler, which
+will run its output through C<MyApache2::EchoBB::lowercase_filter> filter:
 
   Listen 8011
   <VirtualHost _default_:8011>
-      PerlModule                   MyApache::EchoBB
-      PerlProcessConnectionHandler MyApache::EchoBB
-      PerlOutputFilterHandler      MyApache::EchoBB::lowercase_filter
+      PerlModule                   MyApache2::EchoBB
+      PerlProcessConnectionHandler MyApache2::EchoBB
+      PerlOutputFilterHandler      MyApache2::EchoBB::lowercase_filter
   </VirtualHost>
 
 As before we start the httpd server:
@@ -324,21 +324,21 @@
 And here is the implementation of the connection and the filter
 handlers.
 
-  file:MyApache/EchoBB.pm
+  file:MyApache2/EchoBB.pm
   -----------------------
-  package MyApache::EchoBB;
+  package MyApache2::EchoBB;
   
   use strict;
   use warnings FATAL => 'all';
   
-  use Apache::Connection ();
+  use Apache2::Connection ();
   use APR::Socket ();
   use APR::Bucket ();
   use APR::Brigade ();
   use APR::Error ();
   
   use APR::Const    -compile => qw(SUCCESS EOF SO_NONBLOCK);
-  use Apache::Const -compile => qw(OK MODE_GETLINE);
+  use Apache2::Const -compile => qw(OK MODE_GETLINE);
   
   sub handler {
       my $c = shift;
@@ -351,7 +351,7 @@
       my $last = 0;
       while (1) {
           my $rc = $c->input_filters->get_brigade($bb_in,
-                                                  Apache::MODE_GETLINE);
+                                                  Apache2::MODE_GETLINE);
           last if $rc == APR::EOF;
           die APR::Error::strerror($rc) unless $rc == APR::SUCCESS;
   
@@ -382,10 +382,10 @@
       $bb_in->destroy;
       $bb_out->destroy;
   
-      Apache::OK;
+      Apache2::OK;
   }
   
-  use base qw(Apache::Filter);
+  use base qw(Apache2::Filter);
   use constant BUFF_LEN => 1024;
   
   sub lowercase_filter : FilterConnectionHandler {
@@ -395,7 +395,7 @@
           $filter->print(lc $buffer);
       }
     
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   1;
@@ -427,7 +427,7 @@
 won't be buffered but sent to the client right away.
 
 It's possible to make the flushing code simpler, by using a dedicated
-method C<L<fflush()|docs::2.0::api::Apache::Filter/C_fflush_>> that
+method C<L<fflush()|docs::2.0::api::Apache2::Filter/C_fflush_>> that
 does just that -- flushing of the bucket brigade. It replaces 3 lines
 of code:
 
@@ -459,7 +459,7 @@
   
       while (1) {
           my $rc = $c->input_filters->get_brigade($bb,
-                                                  Apache::MODE_GETLINE);
+                                                  Apache2::MODE_GETLINE);
           last if $rc == APR::EOF;
           die APR::Error::strerror($rc) unless $rc == APR::SUCCESS;
   
@@ -481,7 +481,7 @@
   
       $bb->destroy;
   
-      Apache::OK;
+      Apache2::OK;
   }
 
 This code is shorter and simpler. Since it sends out the same bucket
@@ -523,7 +523,7 @@
   
       while (1) {
           my $rc = $c->input_filters->get_brigade($bb,
-                                                  Apache::MODE_GETLINE);
+                                                  Apache2::MODE_GETLINE);
           last if $rc == APR::EOF;
           die APR::Error::strerror($rc) unless $rc == APR::SUCCESS;
   
@@ -532,7 +532,7 @@
   
       $bb->destroy;
   
-      Apache::OK;
+      Apache2::OK;
   }
 
 Since the simplified handler no longer has the condition:
@@ -566,7 +566,7 @@
   
       while (1) {
           my $rc = $c->input_filters->get_brigade($bb,
-                                                  Apache::MODE_GETLINE);
+                                                  Apache2::MODE_GETLINE);
           last if $rc == APR::EOF;
           die APR::Error::strerror($rc) unless $rc == APR::SUCCESS;
   
@@ -583,7 +583,7 @@
   
       $bb->destroy;
   
-      Apache::OK;
+      Apache2::OK;
   }
 
 Notice, that once we slurped the data in the buckets, we had to strip
@@ -609,7 +609,7 @@
 
 =head2 Command Server
 
-The C<MyApache::CommandServer> example is based on the example in the
+The C<MyApache2::CommandServer> example is based on the example in the
 "TCP Servers with IO::Socket" section of the I<perlipc> manpage.  Of
 course, we don't need C<IO::Socket> since Apache takes care of those
 details for us.  The rest of that example can still be used to
@@ -617,7 +617,7 @@
 where a command is sent by the client to be executed on the server
 side, with results sent back to the client.
 
-The C<MyApache::CommandServer> handler will support four commands:
+The C<MyApache2::CommandServer> handler will support four commands:
 C<motd>, C<date>, C<who> and C<quit>.  These are probably not commands
 which can be exploited, but should we add such commands, we'll want to
 limit access based on ip address/hostname, authentication and
@@ -626,18 +626,18 @@
 
 Here is the whole module:
 
-  package MyApache::CommandServer;
+  package MyApache2::CommandServer;
   
   use strict;
   use warnings FATAL => 'all';
   
-  use Apache::Connection ();
-  use Apache::RequestUtil ();
-  use Apache::HookRun ();
-  use Apache::Access ();
+  use Apache2::Connection ();
+  use Apache2::RequestUtil ();
+  use Apache2::HookRun ();
+  use Apache2::Access ();
   use APR::Socket ();
   
-  use Apache::Const -compile => qw(OK DONE DECLINED);
+  use Apache2::Const -compile => qw(OK DONE DECLINED);
   
   my @cmds = qw(motd date who quit);
   my %commands = map { $_, \&{$_} } @cmds;
@@ -646,7 +646,7 @@
       my $c = shift;
       my $socket = $c->client_socket;
   
-      if ((my $rc = login($c)) != Apache::OK) {
+      if ((my $rc = login($c)) != Apache2::OK) {
           $socket->send("Access Denied\n");
           return $rc;
       }
@@ -659,27 +659,27 @@
           next unless $cmd = getline($socket);
   
           if (my $sub = $commands{$cmd}) {
-              last unless $sub->($socket) == Apache::OK;
+              last unless $sub->($socket) == Apache2::OK;
           }
           else {
               $socket->send("Commands: @cmds\n");
           }
       }
   
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   sub login {
       my $c = shift;
   
-      my $r = Apache::RequestRec->new($c);
+      my $r = Apache2::RequestRec->new($c);
       $r->location_merge(__PACKAGE__);
   
       for my $method (qw(run_access_checker run_check_user_id
                          run_auth_checker)) {
           my $rc = $r->$method();
   
-          if ($rc != Apache::OK and $rc != Apache::DECLINED) {
+          if ($rc != Apache2::OK and $rc != Apache2::DECLINED) {
               return $rc;
           }
   
@@ -694,7 +694,7 @@
           }
       }
   
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   sub getline {
@@ -723,7 +723,7 @@
       $socket->send(scalar <$fh>);
       close $fh;
   
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   sub date {
@@ -731,7 +731,7 @@
   
       $socket->send(scalar(localtime) . "\n");
   
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   sub who {
@@ -742,10 +742,10 @@
   
       $socket->send(scalar `who`);
   
-      return Apache::OK;
+      return Apache2::OK;
   }
   
-  sub quit { Apache::DONE }
+  sub quit { Apache2::DONE }
   
   1;
   __END__
@@ -754,13 +754,13 @@
 Next, let's explain what this module does in details.
 
 As with all C<PerlProcessConnectionHandlers>, we are passed an
-C<Apache::Connection> object as the first argument.  Again, we will be
+C<Apache2::Connection> object as the first argument.  Again, we will be
 directly accessing the client socket via the I<client_socket> method.
 The I<login> subroutine is called to check if access by this client
 should be allowed.  This routine makes up for what we lost with the
 core HTTP protocol handler bypassed.
 
-First we call the C<Apache::RequestRec> C<new()> method, which returns
+First we call the C<Apache2::RequestRec> C<new()> method, which returns
 a I<request_rec> object, just like that, which is passed at request
 time to L<HTTP protocol|docs::2.0::user::handlers::http>
 C<Perl*Handlers> and returned by the subrequest API methods,
@@ -774,7 +774,7 @@
 configuration.  For example, should we only wish to allow access to
 this server from certain locations:
 
-  <Location MyApache::CommandServer>
+  <Location MyApache2::CommandServer>
       Order Deny,Allow
       Deny from all
       Allow from 10.*
@@ -786,15 +786,15 @@
 C<run_check_user_id()> and C<run_auth_checker()>.  These methods will
 call directly into the Apache functions that invoke module handlers
 for these phases and will return an integer status code, such as
-C<Apache::OK>, C<Apache::DECLINED> or C<Apache::FORBIDDEN>.  If
-I<run_access_check> returns something other than C<Apache::OK> or
-C<Apache::DECLINED>, that status will be propagated up to the handler
+C<Apache2::OK>, C<Apache2::DECLINED> or C<Apache2::FORBIDDEN>.  If
+I<run_access_check> returns something other than C<Apache2::OK> or
+C<Apache2::DECLINED>, that status will be propagated up to the handler
 routine and then back up to Apache.  Otherwise, the access check
 passed and the loop will break unless C<some_auth_required()> returns
 true.  This would be false given the previous configuration example,
 but would be true in the presence of a C<require> directive, such as:
 
-  <Location MyApache::CommandServer>
+  <Location MyApache2::CommandServer>
       Order Deny,Allow
       Deny from all
       Allow from 10.*
@@ -824,15 +824,15 @@
 returns just one line of data, with newline characters stripped.  If
 the string sent by the client is in our command table, the command is
 then invoked, otherwise a usage message is sent.  If the command does
-not return C<Apache::OK>, we break out of the loop.
+not return C<Apache2::OK>, we break out of the loop.
 
 Let's use this configuration:
 
   Listen 8085
   <VirtualHost _default_:8085>
-      PerlProcessConnectionHandler MyApache::CommandServer
+      PerlProcessConnectionHandler MyApache2::CommandServer
   
-      <Location MyApache::CommandServer>
+      <Location MyApache2::CommandServer>
           Order Deny,Allow
           Allow from 127.0.0.1
           Require user dougm
@@ -859,7 +859,7 @@
   Escape character is '^]'.
   Login: dougm
   Password: foobar
-  Welcome to MyApache::CommandServer
+  Welcome to MyApache2::CommandServer
   Available commands: motd date who quit
   motd
   Have a lot of fun...

Modified: perl/modperl/docs/trunk/src/docs/2.0/user/handlers/server.pod
URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/user/handlers/server.pod?view=diff&r1=159847&r2=159848
==============================================================================
--- perl/modperl/docs/trunk/src/docs/2.0/user/handlers/server.pod (original)
+++ perl/modperl/docs/trunk/src/docs/2.0/user/handlers/server.pod Sat Apr  2 15:32:19 2005
@@ -53,22 +53,22 @@
 Let's look at the following example that demonstrates all the startup
 phases:
 
-  file:MyApache/StartupLog.pm
+  file:MyApache2/StartupLog.pm
   ---------------------------
-  package MyApache::StartupLog;
+  package MyApache2::StartupLog;
   
   use strict;
   use warnings;
   
-  use Apache::Log ();
-  use Apache::ServerUtil ();
+  use Apache2::Log ();
+  use Apache2::ServerUtil ();
   
   use Fcntl qw(:flock);
   use File::Spec::Functions;
   
-  use Apache::Const -compile => 'OK';
+  use Apache2::Const -compile => 'OK';
   
-  my $log_path = catfile Apache::ServerUtil::server_root,
+  my $log_path = catfile Apache2::ServerUtil::server_root,
       "logs", "startup_log";
   my $log_fh;
   
@@ -80,25 +80,25 @@
       my $oldfh = select($log_fh); $| = 1; select($oldfh);
   
       say("process $$ is born to reproduce");
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   sub post_config {
       my($conf_pool, $log_pool, $temp_pool, $s) = @_;
       say("configuration is completed");
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   sub child_init {
       my($child_pool, $s) = @_;
       say("process $$ is born to serve");
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   sub child_exit {
       my($child_pool, $s) = @_;
       say("process $$ now exits");
-      return Apache::OK;
+      return Apache2::OK;
   }
   
   sub say {
@@ -134,11 +134,11 @@
     MaxRequestsPerChild  0
   </IfModule>
   
-  PerlModule            MyApache::StartupLog
-  PerlOpenLogsHandler   MyApache::StartupLog::open_logs
-  PerlPostConfigHandler MyApache::StartupLog::post_config
-  PerlChildInitHandler  MyApache::StartupLog::child_init
-  PerlChildExitHandler  MyApache::StartupLog::child_exit
+  PerlModule            MyApache2::StartupLog
+  PerlOpenLogsHandler   MyApache2::StartupLog::open_logs
+  PerlPostConfigHandler MyApache2::StartupLog::post_config
+  PerlChildInitHandler  MyApache2::StartupLog::child_init
+  PerlChildExitHandler  MyApache2::StartupLog::child_exit
 
 When we perform a server startup followed by a shutdown, the
 I<logs/startup_log> is created if it didn't exist already (it shares
@@ -199,7 +199,7 @@
 phase.
 
 Now let's discuss each of the mentioned startup handlers and their
-implementation in the C<MyApache::StartupLog> module in detail.
+implementation in the C<MyApache2::StartupLog> module in detail.
 
 
 
@@ -225,7 +225,7 @@
 C<L<SRV|docs::2.0::user::config::config/item_SRV>>.
 
 As we have seen in the
-C<L<MyApache::StartupLog::open_logs|/Startup_Phases_Demonstration_Module>>
+C<L<MyApache2::StartupLog::open_logs|/Startup_Phases_Demonstration_Module>>
 handler, the I<open_logs> phase handlers accept four arguments: the
 configuration pool, the logging stream pool, the temporary pool and
 the main server object:
@@ -238,7 +238,7 @@
       my $oldfh = select($log_fh); $| = 1; select($oldfh);
   
       say("process $$ is born to reproduce");
-      return Apache::OK;
+      return Apache2::OK;
   }
 
 In our example the handler opens a log file for appending and sets the
@@ -248,13 +248,13 @@
 As you've seen in the example this handler is configured by adding to
 the top level of I<httpd.conf>:
 
-  PerlOpenLogsHandler MyApache::StartupLog::open_logs
+  PerlOpenLogsHandler MyApache2::StartupLog::open_logs
 
 This handler can be executed only by the main server. If you want to
 traverse the configured virtual hosts, you can accomplish that using a
 simple loop. For example to print out the configured port numbers do:
 
-  use Apache::ServerRec ();
+  use Apache2::ServerRec ();
   # ...
   sub open_logs {
       my($conf_pool, $log_pool, $temp_pool, $s) = @_;
@@ -265,7 +265,7 @@
           my $port = $vs->port;
           warn "vhost port: $port\n";
       }
-      return Apache::OK;
+      return Apache2::OK;
   }
 
 C<$s> is the base server object.
@@ -313,7 +313,7 @@
 all child processes. You can do the same in the startup file, but in
 the I<post_config> phase you have an access to a complete
 configuration tree (via
-C<L<Apache::Directive|docs::2.0::api::Apache::Directive>>).
+C<L<Apache2::Directive|docs::2.0::api::Apache2::Directive>>).
 
 This phase is of type
 C<L<RUN_ALL|docs::2.0::user::handlers::intro/item_RUN_ALL>>.
@@ -321,13 +321,13 @@
 The handler's configuration scope is
 C<L<SRV|docs::2.0::user::config::config/item_SRV>>.
 
-In our C<L<MyApache::StartupLog|/Startup_Phases_Demonstration_Module>>
+In our C<L<MyApache2::StartupLog|/Startup_Phases_Demonstration_Module>>
 example we used the I<post_config()> handler:
 
   sub post_config {
       my($conf_pool, $log_pool, $temp_pool, $s) = @_;
       say("configuration is completed");
-      return Apache::OK;
+      return Apache2::OK;
   }
 
 As you can see, its arguments are identical to the
@@ -338,14 +338,14 @@
 As you've seen in the example this handler is configured by adding to
 I<httpd.conf>:
 
-  PerlPostConfigHandler MyApache::StartupLog::post_config
+  PerlPostConfigHandler MyApache2::StartupLog::post_config
 
 Everything that applies to
 C<L<PerlOpenLogsHandler|/C_PerlOpenLogsHandler_>> identically applies
 to this handler.
 
 The
-C<L<add_version_component()|docs::2.0::api::Apache::ServerUtil/C_add_version_component_>>
+C<L<add_version_component()|docs::2.0::api::Apache2::ServerUtil/C_add_version_component_>>
 includes another useful example.
 
 
@@ -365,7 +365,7 @@
 In the prefork MPM this phase is useful for initializing any data
 structures which should be private to each process. For example
 C<Apache::DBI> pre-opens database connections during this phase and
-C<Apache::Resource> sets the process' resources limits.
+C<Apache2::Resource> sets the process' resources limits.
 
 This phase is of type
 C<L<VOID|docs::2.0::user::handlers::intro/item_VOID>>.
@@ -373,13 +373,13 @@
 The handler's configuration scope is
 C<L<SRV|docs::2.0::user::config::config/item_SRV>>.
 
-In our C<L<MyApache::StartupLog|/Startup_Phases_Demonstration_Module>>
+In our C<L<MyApache2::StartupLog|/Startup_Phases_Demonstration_Module>>
 example we used the I<child_init()> handler:
 
   sub child_init {
       my($child_pool, $s) = @_;
       say("process $$ is born to serve");
-      return Apache::OK;
+      return Apache2::OK;
   }
 
 The I<child_init()> handler accepts two arguments: the child process
@@ -389,7 +389,7 @@
 As you've seen in the example this handler is configured by adding to
 I<httpd.conf>:
 
-  PerlChildInitHandler  MyApache::StartupLog::child_init
+  PerlChildInitHandler  MyApache2::StartupLog::child_init
 
 
 
@@ -409,13 +409,13 @@
 The handler's configuration scope is
 C<L<SRV|docs::2.0::user::config::config/item_SRV>>.
 
-In our C<L<MyApache::StartupLog|/Startup_Phases_Demonstration_Module>>
+In our C<L<MyApache2::StartupLog|/Startup_Phases_Demonstration_Module>>
 example we used the I<child_exit()> handler:
 
   sub child_exit {
       my($child_pool, $s) = @_;
       say("process $$ now exits");
-      return Apache::OK;
+      return Apache2::OK;
   }
 
 The I<child_exit()> handler accepts two arguments: the child process
@@ -425,7 +425,7 @@
 As you've seen in the example this handler is configured by adding to
 I<httpd.conf>:
 
-  PerlChildExitHandler  MyApache::StartupLog::child_exit
+  PerlChildExitHandler  MyApache2::StartupLog::child_exit
 
 
 
@@ -552,7 +552,7 @@
 
 =item *
 
-C<L<E<lt>PerlE<gt> section|docs::2.0::api::Apache::PerlSections>>
+C<L<E<lt>PerlE<gt> section|docs::2.0::api::Apache2::PerlSections>>
 
 =item *
 
@@ -562,7 +562,7 @@
 
 Therefore if you want to trigger an early Perl startup, you could add
 an empty C<L<E<lt>PerlE<gt>
-section|docs::2.0::api::Apache::PerlSections>> in F<httpd.conf>:
+section|docs::2.0::api::Apache2::PerlSections>> in F<httpd.conf>:
 
   <Perl>
   # trigger an early Perl startup
@@ -592,12 +592,11 @@
 
   file:startup.pl
   ---------------
-  use Apache2 ();
   
   use lib qw(/home/httpd/perl);
   
   # enable if the mod_perl 1.0 compatibility is needed
-  # use Apache::compat ();
+  # use Apache2::compat ();
   
   # preload all mp2 modules
   # use ModPerl::MethodLookup;
@@ -605,35 +604,32 @@
   
   use ModPerl::Util (); #for CORE::GLOBAL::exit
   
-  use Apache::RequestRec ();
-  use Apache::RequestIO ();
-  use Apache::RequestUtil ();
-  
-  use Apache::ServerRec ();
-  use Apache::ServerUtil ();
-  use Apache::Connection ();
-  use Apache::Log ();
+  use Apache2::RequestRec ();
+  use Apache2::RequestIO ();
+  use Apache2::RequestUtil ();
+  
+  use Apache2::ServerRec ();
+  use Apache2::ServerUtil ();
+  use Apache2::Connection ();
+  use Apache2::Log ();
   
   use APR::Table ();
   
   use ModPerl::Registry ();
   
-  use Apache::Const -compile => ':common';
+  use Apache2::Const -compile => ':common';
   use APR::Const -compile => ':common';
   
   1;
 
-In this file the C<Apache2> modules is loaded, so L<the 2.0 modules
-will be
-found|docs::2.0::user::config::config/Accessing_the_mod_perl_2_0_Modules>. Afterwards
-C<@INC> in adjusted to include non-standard directories with Perl
-modules:
+In this file C<@INC> in adjusted to include non-standard 
+directories with Perl modules:
 
   use lib qw(/home/httpd/perl);
 
 If you need to use the backwards compatibility layer load:
 
-  use Apache::compat ();
+  use Apache2::compat ();
 
 Next we preload the commonly used mod_perl 2.0 modules and precompile
 common constants.
@@ -651,7 +647,7 @@
 Ideally the code running at the server startup shouldn't be affected
 by L<the apache restart|/Start_Immediately_Restarts>. If however this
 is not the case, you can use
-C<L<Apache::ServerUtil::restart_count|docs::2.0::api::Apache::ServerUtil/C_restart_count_>>.
+C<L<Apache2::ServerUtil::restart_count|docs::2.0::api::Apache2::ServerUtil/C_restart_count_>>.
 
 
 



---------------------------------------------------------------------
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