| 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: webwork-modperl/lib/WeBWorK/PG/Local.pm,v 1.19 2006/01/25 23:13:56 sh002i Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/PG/Local.pm,v 1.20 2006/05/21 00:50:04 gage 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. |
| … | |
… | |
| 39 | use warnings; |
39 | use warnings; |
| 40 | use WeBWorK::Constants; |
40 | use WeBWorK::Constants; |
| 41 | use File::Path qw(rmtree); |
41 | use File::Path qw(rmtree); |
| 42 | use WeBWorK::PG::Translator; |
42 | use WeBWorK::PG::Translator; |
| 43 | use WeBWorK::Utils qw(readFile writeTimingLogEntry); |
43 | use WeBWorK::Utils qw(readFile writeTimingLogEntry); |
|
|
44 | |
|
|
45 | use mod_perl; |
|
|
46 | use constant MP2 => ( exists $ENV{MOD_PERL_API_VERSION} and $ENV{MOD_PERL_API_VERSION} >= 2 ); |
| 44 | |
47 | |
| 45 | # Problem processing will time out after this number of seconds. |
48 | # Problem processing will time out after this number of seconds. |
| 46 | use constant TIMEOUT => $WeBWorK::PG::Local::TIMEOUT || 10; |
49 | use constant TIMEOUT => $WeBWorK::PG::Local::TIMEOUT || 10; |
| 47 | |
50 | |
| 48 | BEGIN { |
51 | BEGIN { |
| … | |
… | |
| 108 | }); |
111 | }); |
| 109 | |
112 | |
| 110 | # evaluate modules and "extra packages" |
113 | # evaluate modules and "extra packages" |
| 111 | #warn "PG: evaluating modules and \"extra packages\"\n"; |
114 | #warn "PG: evaluating modules and \"extra packages\"\n"; |
| 112 | my @modules = @{ $ce->{pg}->{modules} }; |
115 | my @modules = @{ $ce->{pg}->{modules} }; |
|
|
116 | # HACK for apache2 |
|
|
117 | if (MP2) { |
|
|
118 | push @modules, ["Apache2::Log"], ["APR::Table"]; |
|
|
119 | } else { |
|
|
120 | push @modules, ["Apache::Log"]; |
|
|
121 | } |
| 113 | foreach my $module_packages_ref (@modules) { |
122 | foreach my $module_packages_ref (@modules) { |
| 114 | my ($module, @extra_packages) = @$module_packages_ref; |
123 | my ($module, @extra_packages) = @$module_packages_ref; |
| 115 | # the first item is the main package |
124 | # the first item is the main package |
| 116 | $translator->evaluate_modules($module); |
125 | $translator->evaluate_modules($module); |
| 117 | # the remaining items are "extra" packages |
126 | # the remaining items are "extra" packages |