[system] / trunk / webwork2 / conf / database.conf.dist Repository:
ViewVC logotype

View of /trunk/webwork2/conf/database.conf.dist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3822 - (download) (annotate)
Fri Dec 16 23:03:06 2005 UTC (7 years, 5 months ago) by sh002i
File size: 5772 byte(s)
disable gdbm and sql database layouts, remove unneeded config options.
this is the first step in removing support for these deprecated database
layouts.

    1 #!perl
    2 ################################################################################
    3 # WeBWorK Online Homework Delivery System
    4 # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/
    5 # $CVSHeader: webwork2/conf/database.conf.dist,v 1.14 2004/09/27 17:15:47 sh002i Exp $
    6 #
    7 # This program is free software; you can redistribute it and/or modify it under
    8 # the terms of either: (a) the GNU General Public License as published by the
    9 # Free Software Foundation; either version 2, or (at your option) any later
   10 # version, or (b) the "Artistic License" which comes with this package.
   11 #
   12 # This program is distributed in the hope that it will be useful, but WITHOUT
   13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   14 # FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
   15 # Artistic License for more details.
   16 ################################################################################
   17 
   18 =head1 NAME
   19 
   20 database.conf - define stantad database layouts
   21 
   22 =head1 SYNOPSIS
   23 
   24 In global.conf:
   25 
   26  include "conf/database.conf";
   27  *dbLayout = $dbLayouts{layoutName};
   28 
   29 =head1 DESCRIPTION
   30 
   31 This file contains definitions for the commonly-used database layouts. Database
   32 layouts consist of all the information necessary to describe how to access data
   33 used by WeBWorK. For more information on the format of a database layout,
   34 consult the documentation for the WeBWorK::DB module.
   35 
   36 A database layout is selected from the list of possible layouts by adding a
   37 line like the one below to the F<global.conf> or F<course.conf> file.
   38 
   39  $dbLayoutName = "layoutName";
   40  *dbLayout = $dbLayouts{$dbLayoutName};
   41 
   42 =cut
   43 
   44 %dbLayouts = (); # layouts are added to this hash below
   45 
   46 =head1 THE SQL_SINGLE DATABASE LAYOUT
   47 
   48 The C<sql_single> layout is similar to the C<sql> layout, excpet that it uses a
   49 single database for all courses. This is accomplised by prefixing each table
   50 name with the name of the course. The names and passwords of these accounts are
   51 given as parameters to each table in the layout.
   52 
   53  usernameRO     the name of the read-only account
   54  usernameRW     the name of the read-write account
   55  passwordRO     the password for the read-only account
   56  passwordRW     the password for the read-write account
   57 
   58 Be default, the name of the read-only account is "webworkRead", and the name of
   59 the read-write account is "webworkWrite". There are no passwords by default.
   60 It is not recommended that you use only passwords to secure database access.
   61 Most RDBMSs allow IP-based authorization as well. As the system administrator,
   62 IT IS YOUR RESPONSIBILITY TO SECURE DATABASE ACCESS.
   63 
   64 Don't confuse the accounts above with the accounts of the users of a course.
   65 These are system-wide accounts which allow WeBWorK to talk to the database
   66 server.
   67 
   68 Other parameters that can be given are as follows:
   69 
   70  tableOverride  an alternate name to use when referrring to the table (used
   71                 when a table name is a resereved word)
   72  fieldOverride  a hash mapping WeBWorK field names to alternate names to use
   73                 when referring to those fields (used when one or more field
   74         names are reserved words)
   75  debug          if true, SQL statments are printed before being executed
   76 
   77 =cut
   78 
   79 # params common to all tables (also used by "sql" layout)
   80 my %sqlParams = (
   81   usernameRO => "webworkRead",
   82   passwordRO => "",
   83   usernameRW => "webworkWrite",
   84   passwordRW => "",
   85   debug      => 0,
   86 );
   87 
   88 my $sqlSingleDBISource = "dbi:mysql:webwork";
   89 
   90 $dbLayouts{sql_single} = {
   91   password => {
   92     record => "WeBWorK::DB::Record::Password",
   93     schema => "WeBWorK::DB::Schema::SQL",
   94     driver => "WeBWorK::DB::Driver::SQL",
   95     source => $sqlSingleDBISource,
   96     params => { %sqlParams,
   97       tableOverride => "${courseName}_password",
   98     },
   99   },
  100   permission => {
  101     record => "WeBWorK::DB::Record::PermissionLevel",
  102     schema => "WeBWorK::DB::Schema::SQL",
  103     driver => "WeBWorK::DB::Driver::SQL",
  104     source => $sqlSingleDBISource,
  105     params => { %sqlParams,
  106       tableOverride => "${courseName}_permission",
  107     },
  108   },
  109   key => {
  110     record => "WeBWorK::DB::Record::Key",
  111     schema => "WeBWorK::DB::Schema::SQL",
  112     driver => "WeBWorK::DB::Driver::SQL",
  113     source => $sqlSingleDBISource,
  114     params => { %sqlParams,
  115       tableOverride => "${courseName}_key",
  116       fieldOverride => { key => "key_not_a_keyword" },
  117     },
  118   },
  119   user => {
  120     record => "WeBWorK::DB::Record::User",
  121     schema => "WeBWorK::DB::Schema::SQL",
  122     driver => "WeBWorK::DB::Driver::SQL",
  123     source => $sqlSingleDBISource,
  124     params => { %sqlParams,
  125       tableOverride => "${courseName}_user",
  126     },
  127   },
  128   set => {
  129     record => "WeBWorK::DB::Record::Set",
  130     schema => "WeBWorK::DB::Schema::SQL",
  131     driver => "WeBWorK::DB::Driver::SQL",
  132     source => $sqlSingleDBISource,
  133     params => { %sqlParams,
  134       tableOverride => "${courseName}_set"
  135     },
  136   },
  137   set_user => {
  138     record => "WeBWorK::DB::Record::UserSet",
  139     schema => "WeBWorK::DB::Schema::SQL",
  140     driver => "WeBWorK::DB::Driver::SQL",
  141     source => $sqlSingleDBISource,
  142     params => { %sqlParams,
  143       tableOverride => "${courseName}_set_user"
  144     },
  145   },
  146   problem => {
  147     record => "WeBWorK::DB::Record::Problem",
  148     schema => "WeBWorK::DB::Schema::SQL",
  149     driver => "WeBWorK::DB::Driver::SQL",
  150     source => $sqlSingleDBISource,
  151     params => { %sqlParams,
  152       tableOverride => "${courseName}_problem"
  153     },
  154   },
  155   problem_user => {
  156     record => "WeBWorK::DB::Record::UserProblem",
  157     schema => "WeBWorK::DB::Schema::SQL",
  158     driver => "WeBWorK::DB::Driver::SQL",
  159     source => $sqlSingleDBISource,
  160     params => { %sqlParams,
  161       tableOverride => "${courseName}_problem_user"
  162     },
  163   },
  164 };
  165 
  166 =head1 THE SQL DATABASE LAYOUT ($dbLayouts{sql})
  167 
  168 This layout is not supported as of WeBWorK 2.1.4.
  169 
  170 =cut
  171 
  172 =head1 THE GDBM DATABASE LAYOUT ($dbLayouts{gdbm})
  173 
  174 This layout is not supported as of WeBWorK 2.1.4.
  175 
  176 =cut

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9