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

Diff of /trunk/webwork2/lib/WeBWorK/CourseEnvironment.pm

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

Revision 439 Revision 440
1################################################################################
2# WeBWorK mod_perl (c) 1995-2002 WeBWorK Team, Univeristy of Rochester
3# $Id$
4################################################################################
5
1package WeBWorK::CourseEnvironment; 6package WeBWorK::CourseEnvironment;
2 7
3use strict; 8use strict;
4use warnings; 9use warnings;
5use Safe; 10use Safe;
71 bless $self, $class; 76 bless $self, $class;
72 return $self; 77 return $self;
73} 78}
74 79
751; 801;
81
82__END__
83
84=head1 NAME
85
86WeBWorK::CourseEnvironment - Read configuration information from global.conf
87and course.conf files
88
89=head1 SYNOPSIS
90
91 use WeBWorK::CourseEnvironment;
92 $courseEnv = WeBWorK::CourseEnvironment->new($webworkRoot, $courseName);
93
94 $timeout = $courseEnv->{sessionKeyTimeout};
95 $mode = $courseEnv->{pg}->{options}->{displayMode};
96 # etc...
97
98=head1 DESCRIPTION
99
100The WeBWorK::CourseEnvironment module reads the system-wide F<global.conf> and
101course-specific F<course.conf> files used by WeBWorK to calculate and store
102settings needed throughout the system. The F<.conf> files are perl source files
103that can contain any code allowed under the default safe compartment opset.
104After evaluation of both files, any package variables are copied out of the
105safe compartment into a hash. This hash becomes the course environment.
106
107=head1 CONSTRUCTION
108
109=over
110
111=item new (ROOT, COURSE)
112
113The C<new> method finds the file F<conf/global.conf> relative to the given ROOT
114directory. After reading this file, it uses the C<$courseFiles{environment}>
115variable, if present, to locate the course environment file. If found, the file
116is read and added to the environment.
117
118=back
119
120=head1 ACCESS
121
122There are no formal accessor methods. However, since the course environemnt is
123a hash of hashes and arrays, is exists as the self hash of an instance
124variable:
125
126 $courseEnvironment->{someKey}->{someOtherKey};
127
128=head1 AUTHOR
129
130Written by Sam Hathaway, sh002i (at) math.rochester.edu.
131
132=cut

Legend:
Removed from v.439  
changed lines
  Added in v.440

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9