Stas Bekman wrote:
Philippe M. Chiasson wrote:
Stas Bekman wrote:
Philippe M. Chiasson wrote: [...]
Moreover now that I think about it I'm not quite sure why in the world someone will want to turn this feature on. Can you please remind me why was it added at all? If someone wants that badly then can just wrap the whole section in the eval {} block.
As far as I can tell/remember, this is simply a mp1 feature that I wanted to
preserve when porting the <Perl> code to mp2.
I agree that it doesn't add much functionnality that an eval {} block wouldn't
allow (except maybe if the code _doesn't_ compile at all.
How about this?
- Implement PerlSectionsNonFatal = 1
- Deprecate StrictPerlSections with a warning, unless MP_COMPAT_1X is selected ?
If we agree that it has no real added value then we don't want it at all.
Unless somebody can come up with a good reason why we need it, I am quite happy getting rid of this 'feature'
I guess you could check the list archives to see why was it added in first place? Doug is known not to add useless features. Quite possible that we miss the reason.
How about for now we keep things the way they stand when MP_COMPAT_1X=1, and just deprecate it all, making <Perl> sections strict _always_ and if people want errors not to abort startup, just use eval {} ?
Index: Changes =================================================================== RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.408 diff -u -I$Id -r1.408 Changes --- Changes 12 Jul 2004 07:32:07 -0000 1.408 +++ Changes 12 Jul 2004 19:23:10 -0000 @@ -12,6 +12,9 @@
=item 1.99_15-dev
+Deprecate $Apache::Server::StrictPerlSections when MP_COMPAT_1X=0 and +make <Perl> sections errors abort server startup [Gozer] + Fix ($r|$filter|$bucket)->read() functions to run the set magic logic, to handle cases when a passed buffer to fill is not a regular scalar. [Stas] Index: docs/api/Apache/PerlSections.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/PerlSections.pod,v retrieving revision 1.11 diff -u -I$Id -r1.11 PerlSections.pod --- docs/api/Apache/PerlSections.pod 22 May 2004 02:03:27 -0000 1.11 +++ docs/api/Apache/PerlSections.pod 12 Jul 2004 19:23:10 -0000 @@ -150,11 +150,14 @@
=head2 C<$Apache::Server::StrictPerlSections>
-By default, compilation and run-time errors within C<E<lt>Perl E<gt>> -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. +This variable has been deprecated in 2.0, but is still available for +backwards compatibility with mod_perl 1.0 unless 2.0 was built with +C<L<MP_COMPAT_1X=0|docs::2.0::user::install::install/MP_COMPAT_1X>>. + +Now, by default, compilation and run-time errors within C<E<lt>Perl E<gt>> +sections will cause the server to abort startup and report the first error. + +
Index: src/modules/perl/modperl_cmd.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.60
diff -u -I$Id -r1.60 modperl_cmd.c
--- src/modules/perl/modperl_cmd.c 16 Jun 2004 03:55:47 -0000 1.60
+++ src/modules/perl/modperl_cmd.c 12 Jul 2004 19:23:10 -0000
@@ -540,18 +540,22 @@
} if (SvTRUE(ERRSV)) {
+#ifdef MP_COMPAT_1X
SV *strict = MP_STRICT_PERLSECTIONS_SV;
if (strict && SvTRUE(strict)) {
+#endif
char *error = SvPVX(ERRSV);
MP_PERL_RESTORE_CONTEXT;
return error;
+#ifdef MP_COMPAT_1X
}
else {
- modperl_log_warn(s, apr_psprintf(p, "Syntax error at %s:%d %s",
+ modperl_log_warn(s, apr_psprintf(p, "Error at %s:%d %s",
directive->filename,
directive->line_num,
SvPVX(ERRSV)));
}
+#endif
} if (handler) {
Index: todo/release
===================================================================
RCS file: /home/cvs/modperl-2.0/todo/release,v
retrieving revision 1.30
diff -u -I$Id -r1.30 release
--- todo/release 5 Jul 2004 22:02:42 -0000 1.30
+++ todo/release 12 Jul 2004 19:23:10 -0000
@@ -69,10 +69,6 @@
http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=106074969831522&w=2
owner: gozer-* $Apache::Server::StrictPerlSections should be 1 by default (and docs
- updated)
- owner: gozer
-
* Fixing Apache->warn("foo")Report: http://mathforum.org/epigone/modperl-dev/noxtramcay/[EMAIL PROTECTED]
-- -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
signature.asc
Description: OpenPGP digital signature
