Changeset 506

Show
Ignore:
Timestamp:
08/15/06 20:28:01 (2 years ago)
Author:
ben
Message:

Code tidying; missing $CFG initialisation has now been moved from sanitychecks.php to lib/setup.php.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/includes.php

    r503 r506  
    2828        require_once($CFG->dirroot.'lib/elgglib.php'); 
    2929 
    30     // Load setup.php which will initialize database connections and such like. 
    31         require_once($CFG->dirroot.'lib/setup.php'); 
    32  
     30    // Load constants 
     31        require_once($CFG->dirroot.'lib/constants.php'); 
     32         
    3333    /*************************************************************************** 
    3434    *    CORE FUNCTIONALITY LIBRARIES 
    3535    ****************************************************************************/ 
    36      
     36 
     37    // Load setup.php which will initialize database connections and such like. 
     38        require_once($CFG->dirroot.'lib/setup.php'); 
     39         
    3740    // User functions 
    3841        require_once($CFG->dirroot.'lib/userlib.php'); 
     
    4043    // Load required system files: do not edit this line. 
    4144        require_once(dirname(__FILE__)."/includes_system.php"); 
    42  
    43     // Load constants 
    44         require_once($CFG->dirroot.'lib/constants.php'); 
    4545         
    4646    // Check database 
  • devel/lib/setup.php

    r455 r506  
    2525} 
    2626 
     27// Set defaults for some variables 
     28 
    2729if (empty($CFG->debug)) { 
    2830    $CFG->debug = 0; 
     31} 
     32if (empty($CFG->publicinvite)) { 
     33    $CFG->publicinvite = $CFG->publicreg; 
     34} 
     35if (empty($CFG->emailfilter)) { 
     36    $CFG->emailfilter = ""; 
     37} 
     38if (empty($CFG->maxusers)) { 
     39    $CFG->maxusers = 0; 
     40} 
     41if (empty($CFG->walledgarden)) { 
     42    $CFG->walledgarden = 0; 
    2943} 
    3044 
  • devel/sanitychecks.php

    r504 r506  
    2828    } elseif (substr($CFG->dataroot, -1) != "/") { 
    2929        $diemessages[] = 'Configuration problem: The <code>$CFG->dataroot</code> setting in config.php must end with a forward slash (/).'; 
    30     } 
    31      
    32      
    33     // Set defaults for some variables 
    34      
    35     if (!isset($CFG->publicinvite)) { 
    36         $CFG->publicinvite = $CFG->publicreg; 
    37     } 
    38     if (!isset($CFG->emailfilter)) { 
    39         $CFG->emailfilter = ""; 
    40     } 
    41     if (!isset($CFG->maxusers)) { 
    42         $CFG->maxusers = 0; 
    43     } 
    44     if (!isset($CFG->walledgarden)) { 
    45         $CFG->walledgarden = 0; 
    4630    } 
    4731