dougm 02/05/24 09:49:29
Modified: lib/Apache compat.pm
Log:
add Apache::compat::request function
Revision Changes Path
1.49 +15 -7 modperl-2.0/lib/Apache/compat.pm
Index: compat.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- compat.pm 23 May 2002 04:58:05 -0000 1.48
+++ compat.pm 24 May 2002 16:49:29 -0000 1.49
@@ -42,6 +42,20 @@
$INC{'Apache/File.pm'} = __FILE__;
}
+sub request {
+ my $what = shift;
+
+ my $r = Apache->request;
+
+ unless ($r) {
+ die "cannot use $what ",
+ "without 'SetHandler perl-script' ",
+ "or 'PerlOptions +GlobalRequest'";
+ }
+
+ $r;
+}
+
package Apache;
sub exit {
@@ -346,13 +360,7 @@
sub tmpfile {
my $class = shift;
my $limit = 100;
- my $r = Apache->request;
-
- unless ($r) {
- die "cannot use Apache::File->tmpfile ",
- "without 'SetHandler perl-script' ",
- "or 'PerlOptions +GlobalRequest'";
- }
+ my $r = Apache::compat::request('Apache::File->tmpfile');
while ($limit--) {
my $tmpfile = "$TMPDIR/${$}" . $TMPNAM++;