cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
gozer 2004/11/01 16:17:00 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: Clarify the documentation on Apache::PerlSections-dump() about having to place it in it's own Perl block Revision ChangesPath 1.21 +9 -1 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- PerlSections.pod 1 Nov 2004 18:04:18 - 1.20 +++ PerlSections.pod 2 Nov 2004 00:17:00 - 1.21 @@ -165,6 +165,8 @@ Perl + $Apache::PerlSections::Save = 1; + $Port = 8529; $Location{/perl} = { @@ -187,9 +189,10 @@ }, }, }; + /Perl + Perl print Apache::PerlSections-dump; - /Perl This will print something like this: @@ -222,6 +225,11 @@ 1; __END__ + + +It is important to put the call to Cdump in it's own CEltPerl Egt +section, otherwise the content of the current CEltPerl Egt section +will not be dumped. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
gozer 2004/11/01 10:04:18 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: Whitespace fixup Revision ChangesPath 1.20 +10 -10modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- PerlSections.pod 4 Sep 2004 18:37:41 - 1.19 +++ PerlSections.pod 1 Nov 2004 18:04:18 - 1.20 @@ -164,17 +164,17 @@ For example: Perl - + $Port = 8529; - + $Location{/perl} = { SetHandler = perl-script, PerlHandler = Apache::Registry, Options = ExecCGI, }; - + @DirectoryIndex = qw(index.htm index.html); - + $VirtualHost{www.foo.com} = { DocumentRoot = /tmp/docs, ErrorLog = /dev/null, @@ -187,26 +187,26 @@ }, }, }; - + print Apache::PerlSections-dump; - + /Perl This will print something like this: $Port = 8529; - + @DirectoryIndex = ( 'index.htm', 'index.html' ); - + $Location{'/perl'} = ( PerlHandler = 'Apache::Registry', SetHandler = 'perl-script', Options = 'ExecCGI' ); - + $VirtualHost{'www.foo.com'} = ( Location = { '/' = { @@ -219,7 +219,7 @@ DocumentRoot = '/tmp/docs', ErrorLog = '/dev/null' ); - + 1; __END__ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
stas2004/09/04 11:37:41 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: Limit fix Submitted by: Rici Lake [EMAIL PROTECTED] Revision ChangesPath 1.19 +3 -2 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.18 retrieving revision 1.19 diff -u -u -r1.18 -r1.19 --- PerlSections.pod 23 Aug 2004 21:16:03 - 1.18 +++ PerlSections.pod 4 Sep 2004 18:37:41 - 1.19 @@ -44,8 +44,9 @@ AuthName = 'test', DirectoryIndex = [qw(index.html index.htm)], Limit = { -METHODS = 'GET POST', -require = 'user dougm', +GET POST= { +require = 'user dougm', +} }, }; /Perl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
gozer 2004/08/08 17:56:46 Modified:todo release src/docs/2.0/api/Apache PerlSections.pod Log: The only remaining issue in this todo/release entry regarding Perl sections was that you can't write Perl1;/Perl to trigger an early interpreter startup, for instance. This is a limitation of httpd's configuration parser and is just not practical to try and fix. Instead, document the absence of this feature, and suggest using multi-line blocks. Another worthy possibility for early interpreter startup and perl one-liners is to use the (currently under-documented) Perl directive in httpd.conf : Perl 1; Perl warn Hello World; Revision ChangesPath 1.40 +0 -5 modperl-2.0/todo/release Index: release === RCS file: /home/cvs/modperl-2.0/todo/release,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- release 7 Aug 2004 02:52:08 - 1.39 +++ release 9 Aug 2004 00:56:46 - 1.40 @@ -59,11 +59,6 @@ of child_exit. owner: stas -* Perl sections: - A few issues with Perl sections: - http://marc.theaimsgroup.com/?l=apache-modperl-devm=106074969831522w=2 - owner: gozer - * Fixing Apache-warn(foo) Report: http://mathforum.org/epigone/modperl-dev/noxtramcay/[EMAIL PROTECTED] 1.14 +27 -0 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- PerlSections.pod 16 Jul 2004 01:53:20 - 1.13 +++ PerlSections.pod 9 Aug 2004 00:56:46 - 1.14 @@ -334,6 +334,33 @@ +=head2 EltPerlEgt[...] was not closed. + +On encountering a one-line EltPerlEgt block, +httpd's configuration parser will cause a startup +failure with an error similar to this one: + + Starting httpd: + Syntax error on line ... of /etc/httpd/conf/httpd.conf: + Perluse was not closed. + +If you have written a simple one-line EltPerlEgt +section like this one : + + Perluse Apache::DBI;/Perl + +change it to be: + + Perl + use Apache::DBI; + /Perl + +This is caused by a limitation of httpd's configuration +parser and is not likely to be changed to allow one-line +block like the example above. Use multi-line blocks instead. + + + =head1 See Also - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
stas2004/08/08 18:20:34 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: fix pod Revision ChangesPath 1.15 +1 -1 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.14 retrieving revision 1.15 diff -u -u -r1.14 -r1.15 --- PerlSections.pod 9 Aug 2004 00:56:46 - 1.14 +++ PerlSections.pod 9 Aug 2004 01:20:34 - 1.15 @@ -334,7 +334,7 @@ -=head2 EltPerlEgt[...] was not closed. +=head2 EltPerlEgt[...] was not closed. On encountering a one-line EltPerlEgt block, httpd's configuration parser will cause a startup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
gozer 2004/08/08 21:34:54 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: Fix the typo fix. It wasn't a stray but it needed to be escaped proprely Revision ChangesPath 1.16 +1 -1 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- PerlSections.pod 9 Aug 2004 01:20:34 - 1.15 +++ PerlSections.pod 9 Aug 2004 04:34:54 - 1.16 @@ -334,7 +334,7 @@ -=head2 EltPerlEgt[...] was not closed. +=head2 EltPerlEgt[...]Egt was not closed. On encountering a one-line EltPerlEgt block, httpd's configuration parser will cause a startup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
stas2004/07/15 18:53:20 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: complete the manpages Revision ChangesPath 1.13 +46 -21modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.12 retrieving revision 1.13 diff -u -u -r1.12 -r1.13 --- PerlSections.pod 13 Jul 2004 03:59:46 - 1.12 +++ PerlSections.pod 16 Jul 2004 01:53:20 - 1.13 @@ -13,7 +13,7 @@ #run the server as whoever starts it $User = getpwuid() || ; - $Group = getgrgid()) || ); + $Group = getgrgid()) || ); $ServerAdmin = $User; @@ -110,18 +110,20 @@ - -=head1 @PerlConfig and $PerlConfig -This array and scalar can be used to introduce litteral configuration + +=head1 C@PerlConfig and C$PerlConfig + +This array and scalar can be used to introduce literal configuration into the apache configuration. For example: push @PerlConfig, 'Alias /foo /bar'; Or: $PerlConfig .= Alias /foo /bar\n; - -See also CL$r-Egtadd_config|docs::2.0::api::Apache::RequestUtil/C_add_config_ + +See also +CL$r-Egtadd_config|docs::2.0::api::Apache::RequestUtil/C_add_config_ @@ -148,15 +150,17 @@ -=head1 PerlSections dumping +=head1 PerlSections Dumping + + =head2 Apache::PerlSections-Egtdump This method will dump out all the configuration variables mod_perl will be feeding to the apache config gears. The output is suitable to -read back in via Ceval +read back in via Ceval. -Example: +For example: Perl @@ -181,7 +185,7 @@ Allow = 'from foo.com', }, }, - }; + }; print Apache::PerlSections-dump; @@ -218,11 +222,19 @@ 1; __END__ + + + + =head2 Apache::PerlSections-Egtstore This method will call the Cdump method, writing the output to a file, suitable to be pulled in via Crequire or Cdo. + + + + =head1 Advanced API mod_perl 2.0 now introduces the same general concept of handlers to @@ -234,7 +246,7 @@ Perl handler=My::PerlSection::Handler somearg=test1 $foo = 1; -$bar = 2; +$bar = 2; /Perl And in My/PerlSection/Handler.pm: @@ -246,25 +258,34 @@ So, when that given CEltPerl Egt block in encountered, the code within will first be evaluated, then the handler routine will be -invoked with 3 arguments +invoked with 3 arguments: + +=over + +=item arg1: C$self + +self-explanatory + +=item arg2: C$parms +( CLApache::CmdParms|docs::2.0::api::Apache::CmdParms ) -C$self is self-explanatory +C$parms is specific for the current Container, for example, you +might want to call C$parms-Egtserver() to get the current server. -C$parms is the -CLApache::CmdParms|docs::2.0::api::Apache::CmdParms for this -Container, for example, you might want to call C$parms-Egtserver() -to get the current server. +=item arg3: C$args +( CLAPR::Table object|docs::2.0::api::APR::Table) -C$args is an CLAPR::Table|docs::2.0::api::APR::Table object of -the section arguments, the 2 guaranteed ones will be: +the table object of the section arguments. The 2 guaranteed ones will +be: $args-{'handler'} = 'My::PerlSection::Handler'; - - $args-{'package'} = 'Apache::ReadConfig'; + $args-{'package'} = 'Apache::ReadConfig'; Other Cname=value pairs given on the CEltPerl Egt line will also be included. +=back + At this point, it's up to the handler routing to inspect the namespace of the C$args-Egt{'package'} and chooses what to do. @@ -312,9 +333,13 @@ + + =head1 See Also Lmod_perl 2.0 documentation|docs::2.0::index. + + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
gozer 2004/03/17 15:44:07 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: Minimally document @PerlConfig and $PerlConfig in Perl sections Revision ChangesPath 1.10 +13 -0 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- PerlSections.pod 29 Feb 2004 08:54:59 - 1.9 +++ PerlSections.pod 17 Mar 2004 23:44:07 - 1.10 @@ -110,6 +110,19 @@ + +=head1 @PerlConfig and $PerlConfig + +This array and scalar can be used to introduce litteral configuration +into the apache configuration. For example: + + push @PerlConfig, 'Alias /foo /bar'; + +Or: + $PerlConfig .= Alias /foo /bar\n; + +See also CL$r-Egtadd_config|docs::2.0::api::Apache::RequestUtil/C_add_config_ + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
stas2004/02/29 00:54:59 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: escape - in pod Revision ChangesPath 1.9 +2 -2 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.8 retrieving revision 1.9 diff -u -u -r1.8 -r1.9 --- PerlSections.pod 29 Feb 2004 05:28:43 - 1.8 +++ PerlSections.pod 29 Feb 2004 08:54:59 - 1.9 @@ -148,7 +148,7 @@ =head1 PerlSections dumping -=head2 Apache::PerlSections-dump +=head2 Apache::PerlSections-Egtdump This method will dump out all the configuration variables mod_perl will be feeding to the apache config gears. The output is suitable to @@ -216,7 +216,7 @@ 1; __END__ -=head2 Apache::PerlSections-store +=head2 Apache::PerlSections-Egtstore This method will call the Cdump method, writing the output to a file, suitable to be pulled in via Crequire or Cdo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
stas2003/10/13 21:09:59 Modified:src/docs/2.0/user/troubleshooting troubleshooting.pod src/docs/2.0/api/Apache PerlSections.pod Log: document the bug with 2.0.47 and earlier (Perl directive missing closing '') Revision ChangesPath 1.14 +6 -0 modperl-docs/src/docs/2.0/user/troubleshooting/troubleshooting.pod Index: troubleshooting.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/troubleshooting/troubleshooting.pod,v retrieving revision 1.13 retrieving revision 1.14 diff -u -u -r1.13 -r1.14 --- troubleshooting.pod 29 Aug 2003 17:33:55 - 1.13 +++ troubleshooting.pod 14 Oct 2003 04:09:59 - 1.14 @@ -70,6 +70,12 @@ Update DBI to at least version 1.31. + +=head2 EltPerlEgt directive missing closing 'Egt' + +See the LApache::PerlSections|docs::2.0::api::Apache::PerlSections/E_lt_PerlE_gt__directive_missing_closing__E_gt__ manpage. + + =head1 Shutdown and Restart 1.6 +25 -0 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.5 retrieving revision 1.6 diff -u -u -r1.5 -r1.6 --- PerlSections.pod 9 Jun 2003 06:07:25 - 1.5 +++ PerlSections.pod 14 Oct 2003 04:09:59 - 1.6 @@ -175,4 +175,29 @@ Would create a new alias. The source code of CApache::PerlSections is a good place to look for a practical example. +=head1 Bugs + +=head2 EltPerlEgt directive missing closing 'Egt' + +httpd-2.0.47 and earlier had a bug in the configuration parser which +caused the startup failure with the following error: + + Starting httpd: + Syntax error on line ... of /etc/httpd/conf/httpd.conf: + Perl directive missing closing '' [FAILED] + +This has been fixed in httpd-2.0.48. If you can't upgrade to this or a +higher version, please add a space before the closing 'Egt' of the +opening tag as a workaround. So if you had: + + Perl + # some code + /Perl + +change it to be: + + Perl + # some code + /Perl + =cut - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
gozer 2003/06/08 22:06:34 Modified:src/docs/2.0/api config.cfg Added: src/docs/2.0/api/Apache PerlSections.pod Log: Initial shot at documenting Perl sections in mp2. Extended from an e-mail on dev@perl.apache.org Revision ChangesPath 1.25 +1 -0 modperl-docs/src/docs/2.0/api/config.cfg Index: config.cfg === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/config.cfg,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- config.cfg23 May 2003 05:20:53 - 1.24 +++ config.cfg9 Jun 2003 05:06:34 - 1.25 @@ -24,6 +24,7 @@ Apache/Filter.pod Apache/FilterRec.pod Apache/Log.pod + Apache/PerlSections.pod Apache/RequestRec.pod Apache/RequestUtil.pod Apache/ServerUtil.pod 1.1 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === =head1 NAME Apache::PerlSections - Default Handler for CEltPerl Egt sections =head1 Synopsis Perl @PerlModule = qw(Mail::Send Devel::Peek); #run the server as whoever starts it $User = getpwuid() || ; $Group = getgrgid()) || ); $ServerAdmin = $User; /Perl =head1 Description With CEltPerl Egt...CElt/PerlEgt sections, it is possible to configure your server entirely in Perl. CEltPerl Egt sections can contain Iany and as much Perl code as you wish. These sections are compiled into a special package whose symbol table mod_perl can then walk and grind the names and values of Perl variables/structures through the Apache core configuration gears. Block sections such as CEltLocationEgt..CElt/LocationEgt are represented in a C%Location hash, e.g.: Perl $Location{/~dougm/} = { AuthUserFile = '/tmp/htpasswd', AuthType = 'Basic', AuthName = 'test', DirectoryIndex = [qw(index.html index.htm)], Limit = { METHODS = 'GET POST', require = 'user dougm', }, }; /Perl If an Apache directive can take two or three arguments you may push strings (the lowest number of arguments will be shifted off the C@list) or use an array reference to handle any number greater than the minimum for that directive: push @Redirect, /foo, http://www.foo.com/;; push @Redirect, /imdb, http://www.imdb.com/;; push @Redirect, [qw(temp /here http://www.there.com;)]; Other section counterparts include C%VirtualHost, C%Directory and C%Files. To pass all environment variables to the children with a single configuration directive, rather than listing each one via CPassEnv or CPerlPassEnv, a CEltPerl Egt section could read in a file and: push @PerlPassEnv, [$key = $val]; or Apache-httpd_conf(PerlPassEnv $key $val); These are somewhat simple examples, but they should give you the basic idea. You can mix in any Perl code you desire. See Ieg/httpd.conf.pl and Ieg/perl_sections.txt in the mod_perl distribution for more examples. Assume that you have a cluster of machines with similar configurations and only small distinctions between them: ideally you would want to maintain a single configuration file, but because the configurations aren't Iexactly the same (e.g. the CServerName directive) it's not quite that simple. CEltPerl Egt sections come to rescue. Now you have a single configuration file and the full power of Perl to tweak the local configuration. For example to solve the problem of the CServerName directive you might have this CEltPerl Egt section: Perl $ServerName = `hostname`; /Perl For example if you want to allow personal directories on all machines except the ones whose names start with Isecure: Perl $ServerName = `hostname`; if ( $ServerName !~ /^secure/) { $UserDir = public.html; } else { $UserDir = DISABLED; } /Perl =head1 Configuration Variables There are a few variables that can be set to change the default behaviour of CEltPerl Egt sections. =head2 C$Apache::Server::SaveConfig By default, the namespace in which CEltPerl Egt sections are evaluated is cleared after each block closes. By setting it to a true value, the content of those namespaces will be preserved and will be available for inspection by modules like LApache::Status =head2 C$Apache::Server::StrictPerlSections By default, compilation and run-time errors within CEltPerl Egt sections will cause a warning to be printed in the error_log. By setting this variable to a true value, code in the sections will be evaluated as if use strict was in usage, and all warning and errors will cause the server to abort
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
stas2003/06/08 22:58:44 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: paras need to be wrapped 74 Revision ChangesPath 1.2 +33 -25modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PerlSections.pod 9 Jun 2003 05:06:34 - 1.1 +++ PerlSections.pod 9 Jun 2003 05:58:44 - 1.2 @@ -101,29 +101,32 @@ =head1 Configuration Variables -There are a few variables that can be set to change the default behaviour of CEltPerl -Egt sections. +There are a few variables that can be set to change the default +behaviour of CEltPerl Egt sections. =head2 C$Apache::Server::SaveConfig -By default, the namespace in which CEltPerl Egt sections are evaluated is cleared after -each block closes. By setting it to a true value, the content of those namespaces will be preserved -and will be available for inspection by modules like LApache::Status +By default, the namespace in which CEltPerl Egt sections are +evaluated is cleared after each block closes. By setting it to a true +value, the content of those namespaces will be preserved and will be +available for inspection by modules like LApache::Status =head2 C$Apache::Server::StrictPerlSections -By default, compilation and run-time errors within CEltPerl Egt sections will cause a warning -to be printed in the error_log. By setting this variable to a true value, code in the sections will -be evaluated as if use strict was in usage, and all warning and errors will cause the server to -abort startup and report the first error. +By default, compilation and run-time errors within CEltPerl Egt +sections will cause a warning to be printed in the error_log. By +setting this variable to a true value, code in the sections will be +evaluated as if use strict was in usage, and all warning and errors +will cause the server to abort startup and report the first error. =head1 Advanced API -mod_perl 2.0 now introduces the same general concept of handlers to CEltPerl Egt sections. -Apache::PerlSections simply being the default handler for them. +mod_perl 2.0 now introduces the same general concept of handlers to +CEltPerl Egt sections. Apache::PerlSections simply being the +default handler for them. -To specify a different handler for a given perl section, an extra handler argument must be given to -the section: +To specify a different handler for a given perl section, an extra +handler argument must be given to the section: Perl handler=My::PerlSection::Handler somearg=test1 $foo = 1; @@ -137,31 +140,36 @@ #do your thing! } -So, when that given CEltPerl Egt block in encountered, the code within will first be evaluated, then -the handler routine will be invoked with 3 arguments +So, when that given CEltPerl Egt block in encountered, the code +within will first be evaluated, then the handler routine will be +invoked with 3 arguments C$self is self-explanatory -C$parms is the LApache::CmdParms for this Container, for example, you might want to call C$parms-Egtserver() -to get the current server. +C$parms is the LApache::CmdParms for this Container, for example, +you might want to call C$parms-Egtserver() to get the current +server. -C$args is a LAPR::Table of the section arguments, the 2 guaranteed ones will be: +C$args is a LAPR::Table of the section arguments, the 2 guaranteed +ones will be: $args-{'handler'} = 'My::PerlSection::Handler'; $args-{'package'} = 'Apache::ReadConfig'; -Other name=value pairs given on the CEltPerl Egt line will also be included. +Other Cname=value pairs given on the CEltPerl Egt line will +also be included. -At this point, it's up to the handler routing to inspect the namespace of the C$args-Egt{'package'} and -chooses what to do. +At this point, it's up to the handler routing to inspect the namespace +of the C$args-Egt{'package'} and chooses what to do. -The most likely thing to do is to feed configuration data back into apache. To do that, use -Apache::Server-Egtadd_config(directive), for example: +The most likely thing to do is to feed configuration data back into +apache. To do that, use Apache::Server-Egtadd_config(directive), +for example: $parms-server-add_config(Alias /foo /bar); -Would create a new alias. The source code of LApache::PerlSections is a good place to look for a practical -example. +Would create a new alias. The source code of LApache::PerlSections +is a good place to look for a practical example. =cut
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
stas2003/06/08 23:05:14 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: - s/Perl/Perl / - indent code 4 chars Revision ChangesPath 1.4 +16 -15modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PerlSections.pod 9 Jun 2003 06:02:17 - 1.3 +++ PerlSections.pod 9 Jun 2003 06:05:14 - 1.4 @@ -31,13 +31,13 @@ Perl $Location{/~dougm/} = { -AuthUserFile = '/tmp/htpasswd', -AuthType = 'Basic', -AuthName = 'test', +AuthUserFile = '/tmp/htpasswd', +AuthType = 'Basic', +AuthName = 'test', DirectoryIndex = [qw(index.html index.htm)], -Limit = { - METHODS = 'GET POST', - require = 'user dougm', +Limit = { +METHODS = 'GET POST', +require = 'user dougm', }, }; @@ -83,19 +83,20 @@ configuration. For example to solve the problem of the CServerName directive you might have this CEltPerl Egt section: - Perl + Perl $ServerName = `hostname`; /Perl For example if you want to allow personal directories on all machines except the ones whose names start with Isecure: - Perl + Perl $ServerName = `hostname`; - if ( $ServerName !~ /^secure/) { -$UserDir = public.html; - } else { -$UserDir = DISABLED; + if ($ServerName !~ /^secure/) { + $UserDir = public.html; + } + else { + $UserDir = DISABLED; } /Perl @@ -137,9 +138,9 @@ And in My/PerlSection/Handler.pm: sub My::Handler::handler : handler { -my($self, $parms, $args) = @_; -#do your thing! -} + my($self, $parms, $args) = @_; + #do your thing! + } So, when that given CEltPerl Egt block in encountered, the code within will first be evaluated, then the handler routine will be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: modperl-docs/src/docs/2.0/api/Apache PerlSections.pod
stas2003/06/08 23:07:25 Modified:src/docs/2.0/api/Apache PerlSections.pod Log: the NAME para can't include any markup, because it ends up in title/title which can't grok embedded HTML markup in most browsers Revision ChangesPath 1.5 +1 -1 modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod Index: PerlSections.pod === RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PerlSections.pod 9 Jun 2003 06:05:14 - 1.4 +++ PerlSections.pod 9 Jun 2003 06:07:25 - 1.5 @@ -1,6 +1,6 @@ =head1 NAME -Apache::PerlSections - Default Handler for CEltPerl Egt sections +Apache::PerlSections - Default Handler for Perl sections =head1 Synopsis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]