[system] / branches / rel-2-4-patches / webwork-modperl / lib / WeBWorK / Request.pm Repository:
ViewVC logotype

Diff of /branches/rel-2-4-patches/webwork-modperl/lib/WeBWorK/Request.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3973 Revision 4192
1################################################################################ 1################################################################################
2# WeBWorK Online Homework Delivery System 2# WeBWorK Online Homework Delivery System
3# Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader: webwork2/lib/WeBWorK/Request.pm,v 1.3 2005/11/07 21:18:13 sh002i Exp $ 4# $CVSHeader: webwork2/lib/WeBWorK/Request.pm,v 1.4 2006/01/25 23:13:51 sh002i Exp $
5# 5#
6# This program is free software; you can redistribute it and/or modify it under 6# This program is free software; you can redistribute it and/or modify it under
7# the terms of either: (a) the GNU General Public License as published by the 7# the terms of either: (a) the GNU General Public License as published by the
8# Free Software Foundation; either version 2, or (at your option) any later 8# Free Software Foundation; either version 2, or (at your option) any later
9# version, or (b) the "Artistic License" which comes with this package. 9# version, or (b) the "Artistic License" which comes with this package.
13# FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the 13# FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the
14# Artistic License for more details. 14# Artistic License for more details.
15################################################################################ 15################################################################################
16 16
17package WeBWorK::Request; 17package WeBWorK::Request;
18use base qw(Apache::Request);
19 18
20=head1 NAME 19=head1 NAME
21 20
22WeBWorK::Request - a request to the WeBWorK system, a subclass of 21WeBWorK::Request - a request to the WeBWorK system, a subclass of
23Apache::Request with additional WeBWorK-specific fields. 22Apache::Request with additional WeBWorK-specific fields.
24 23
25=cut 24=cut
26 25
27use strict; 26use strict;
28use warnings; 27use warnings;
28
29use mod_perl;
30use constant MP2 => ( exists $ENV{MOD_PERL_API_VERSION} and $ENV{MOD_PERL_API_VERSION} >= 2 );
31
32# This class inherits from Apache::Request under mod_perl and Apache2::Request under mod_perl2
33BEGIN {
34 if (MP2) {
35 require Apache2::Request;
36 Apache2::Request->import;
37 push @WeBWorK::Request::ISA, "Apache2::Request";
38 } else {
39 require Apache::Request;
40 Apache::Request->import;
41 push @WeBWorK::Request::ISA, "Apache::Request";
42 }
43}
29 44
30=head1 CONSTRUCTOR 45=head1 CONSTRUCTOR
31 46
32=over 47=over
33 48
49=cut 64=cut
50 65
51sub new { 66sub new {
52 my ($invocant, @args) = @_; 67 my ($invocant, @args) = @_;
53 my $class = ref $invocant || $invocant; 68 my $class = ref $invocant || $invocant;
69 # construct the appropriate superclass instance depending on mod_perl version
70 my $apreq_class = MP2 ? "Apache2::Request" : "Apache::Request";
54 return bless { r => Apache::Request->new(@args) }, $class; 71 return bless { r => $apreq_class->new(@args) }, $class;
55} 72}
56 73
57=back 74=back
58 75
59=cut 76=cut

Legend:
Removed from v.3973  
changed lines
  Added in v.4192

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9