[system] / trunk / webwork2 / lib / WeBWorK / Cookie.pm Repository:
ViewVC logotype

View of /trunk/webwork2/lib/WeBWorK/Cookie.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4190 - (download) (as text) (annotate)
Thu Jun 29 21:10:52 2006 UTC (6 years, 10 months ago) by sh002i
File size: 1659 byte(s)
WeBWorK::Cookie inherits from Apache::Cookie or Apache2::Cookie
depending on the mod_perl version.

    1 ################################################################################
    2 # WeBWorK Online Homework Delivery System
    3 # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/
    4 # $CVSHeader: webwork2/lib/WeBWorK/Upload.pm,v 1.7 2006/01/25 23:13:51 sh002i Exp $
    5 #
    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
    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.
   10 #
   11 # This program is distributed in the hope that it will be useful, but WITHOUT
   12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   13 # FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
   14 # Artistic License for more details.
   15 ################################################################################
   16 
   17 package WeBWorK::Cookie;
   18 
   19 =head1 NAME
   20 
   21 WeBWorK::Cookie - inherit from either Apache::Cookie or Apache2::Cookie
   22 depending on mod_perl version.
   23 
   24 =head1 SYNOPSIS
   25 
   26 Given C<$r>, a WeBWorK::Request object
   27 
   28  my $cookie = new WeBWorK::Cookie
   29 
   30 =cut
   31 
   32 use strict;
   33 use warnings;
   34 
   35 use mod_perl;
   36 use constant MP2 => ( exists $ENV{MOD_PERL_API_VERSION} and $ENV{MOD_PERL_API_VERSION} >= 2 );
   37 
   38 # This class inherits from Apache::Cookie under mod_perl and Apache2::Cookie under mod_perl2
   39 BEGIN {
   40   if (MP2) {
   41     require Apache2::Cookie;
   42     Apache2::Cookie->import;
   43     push @WeBWorK::Cookie::ISA, "Apache2::Cookie";
   44   } else {
   45     require Apache::Cookie;
   46     Apache::Cookie->import;
   47     push @WeBWorK::Cookie::ISA, "Apache::Cookie";
   48   }
   49 }
   50 
   51 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9