~ubuntu-branches/ubuntu/edgy/libapache2-mod-perl2/edgy

« back to all changes in this revision

Viewing changes to docs/api/ModPerl/RegistryLoader.pod

  • Committer: Bazaar Package Importer
  • Author(s): Andres Salomon
  • Date: 2005-08-12 01:40:38 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050812014038-gjigefs55pqx4qc8
Tags: 2.0.1-3
Grr.  Really include perl.conf file; it got lost due to diff not
wanting to add an empty file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
  # in startup.pl
8
8
  use ModPerl::RegistryLoader ();
9
 
  use APR::Pool ();
 
9
  use File::Spec ();
10
10
  
11
 
  # explicit uri => filename mapping 
 
11
  # explicit uri => filename mapping
12
12
  my $rlbb = ModPerl::RegistryLoader->new(
13
13
      package => 'ModPerl::RegistryBB',
14
14
      debug   => 1, # default 0
19
19
  ###
20
20
  # uri => filename mapping using a helper function
21
21
  sub trans {
22
 
      my $uri = shift; 
 
22
      my $uri = shift;
23
23
      $uri =~ s|^/registry/|cgi-bin/|;
24
 
      return Apache::Server::server_root_relative(APR::Pool->new, $uri);
 
24
      return File::Spec->catfile(Apache2::ServerUtil::server_root, $uri);
25
25
  }
26
26
  my $rl = ModPerl::RegistryLoader->new(
27
27
      package => 'ModPerl::Registry',
129
129
  {
130
130
      # test the scripts pre-loading by using trans sub
131
131
      use ModPerl::RegistryLoader ();
132
 
      use APR::Pool ();
 
132
      use File::Spec ();
133
133
      use DirHandle ();
134
134
      use strict;
135
135
  
136
 
      my $pool = APR::Pool->new;
137
 
 
138
 
      my $dir = Apache::Server::server_root_relative($pool, "cgi-bin");
 
136
      my $dir = File::Spec->catdir(Apache2::ServerUtil::server_root,
 
137
                                  "cgi-bin");
139
138
  
140
139
      sub trans {
141
140
          my $uri = shift; 
142
141
          $uri =~ s|^/registry/|cgi-bin/|;
143
 
          return Apache::Server::server_root_relative($pool, $uri);
 
142
          return File::Spec->catfile(Apache2::ServerUtil::server_root,
 
143
                                     $uri);
144
144
      }
145
145
  
146
146
      my $rl = ModPerl::RegistryLoader->new(
180
180
 
181
181
=head1 Authors
182
182
 
183
 
The original C<Apache::RegistryLoader> implemented by Doug MacEachern.
 
183
The original C<Apache2::RegistryLoader> implemented by Doug MacEachern.
184
184
 
185
185
Stas Bekman did the porting to the new registry framework based on
186
186
C<ModPerl::RegistryLoader>.