gozer       2004/09/13 17:20:51

  Modified:    src/docs/2.0/api/Apache Directive.pod
  Log:
  Added a few examples
  
  Revision  Changes    Path
  1.10      +46 -0     modperl-docs/src/docs/2.0/api/Apache/Directive.pod
  
  Index: Directive.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/Directive.pod,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Directive.pod     13 Sep 2004 23:22:18 -0000      1.9
  +++ Directive.pod     14 Sep 2004 00:20:50 -0000      1.10
  @@ -86,6 +86,19 @@
   
   =back
   
  +For example, in F<httpd.conf>:
  +
  +  PerlSwitches -M/opt/lib -M/usr/local/lib -wT
  +
  +And later:
  +
  +  my $tree = Apache::Directive->conftree;
  +  my $node = $tree->lookup('PerlSwitches');
  +  my $args = $node->args;
  +
  +C<$args> now contains the string "-M/opt/lib -M/usr/local/lib -wT"
  +
  +
   
   
   
  @@ -111,6 +124,26 @@
   
   =back
   
  +For example: in F<httpd.conf>:
  +
  +  <Location /test>
  +    SetHandler perl-script
  +    PerlHandler Test::Module
  +  </Location>
  +
  +And later:
  +
  +  my $tree = Apache::Directive->conftree;
  +  my $node = $tree->lookup('Location', '/test/');
  +  my $hash = $node->as_hash;
  +
  +C<$hash> now is:
  +
  +  {
  +    'SetHandler'  => 'perl-script',
  +    'PerlHandler' => 'Test::Module',
  +  }
  +
   
   
   
  @@ -207,6 +240,19 @@
   
   =back
   
  +For example:
  +
  +  my $tree = Apache::Directive->conftree;
  +  my $node = $tree->lookup('VirtualHost', 'example.com');
  +  my $filename = $node->filename;
  +
  +C<$filename> is now the full path to the F<httpd.conf> that
  +VirtualHost was defined in.
  +
  +If the directive was added with 
  +C<L<add_config()|docs::2.0::api::Apache::ServerUtil/C_add_config_>>,
  +the filename will be the path to the F<httpd.conf> that trigerred
  +that Perl code.
   
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to