Changeset 419

Show
Ignore:
Timestamp:
07/02/06 14:14:38 (2 years ago)
Author:
sven
Message:

rearrange sanity checks to actually be useful again, and use the CFG vars

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/config-dist.php

    r394 r419  
    3434// dataroot. this is where uploaded files will go (and sessions for now) 
    3535// This should be OUTSIDE your wwwroot. 
     36// NB: **MUST** have a final slash at the end 
    3637$CFG->dataroot = ''; 
    3738// You may change these values to something else but you must ensure that 
  • devel/includes.php

    r298 r419  
    66    // that is not part of the standard distribution. 
    77        require_once(dirname(__FILE__)."/config.php"); 
     8 
     9    // Check config values make sense 
     10        require_once(dirname(__FILE__).'/sanitychecks.php'); 
    811 
    912    // Load datalib 
  • devel/includes_system.php

    r394 r419  
    77    *    You should ideally not edit this file. 
    88    ****************************************************************************/ 
    9  
    10  
    11  
    12  
    13     // Sanity checks - conditions under which Elgg will refuse to run 
    14     // TODO - this'll no doubt want polishing and gettexting :) - Sven 
    15      
    16     $diemessages = array(); 
    17      
    18     if (!defined("path") || (substr(path, -1) != "/")) { 
    19         $diemessages[] = "Configuration problem: The 'path' setting in includes.php must end with a forward slash (/)."; 
    20     } 
    21     if (!defined("url") || (substr(url, -1) != "/")) { 
    22         $diemessages[] = "Configuration problem: The 'url' setting in includes.php must end with a forward slash (/)."; 
    23     } 
    24     if (ini_get('register_globals')) { 
    25         // this shouldn't be needed due to the htaccess file, but just in case... 
    26         $diemessages[] = " 
    27             Configuration problem: The PHP setting 'register_globals', which is a huge security risk, is turned on. 
    28             There should be a line in the .htaccess file as follows: <code>php_flag register_globals off</code> 
    29             If the line is present but has a # at the start, remove the # character. 
    30         "; 
    31     } 
    32     switch ($CFG->dbtype) { 
    33         case 'mysql': 
    34             $funcheck = 'mysql_query'; 
    35             break; 
    36         case 'postgres7': 
    37             $funcheck = 'pg_query'; 
    38             break; 
    39     } 
    40     if (!function_exists($funcheck)) { 
    41         // people have been having a spot of trouble installing elgg without the mysql php module... 
    42         $diemessages[] = " 
    43             Installation problem: Can't find the PHP MySQL or Postgresql module. 
    44             Even with PHP and MySQL or Postgresql installed, sometimes the module to connect them is missing. 
    45             Please check your PHP installation. 
    46         "; 
    47     } 
    48      
    49      
    50     if (count($diemessages)) { 
    51         $diebody  = '<html><body><h1>Error - Elgg cannot run</h1><ul>'; 
    52         $diebody .= '<li>' . implode("</li><li>", $diemessages) . '</li>'; 
    53         $diebody .= '</ul><p>Please read the INSTALL file for more information.</p></body></html>'; 
    54         die($diebody); 
    55     } else { 
    56         unset($diemessages); 
    57     } 
    58      
    59      
    60      
    61      
    629     
    6310    // Plug-in engine (must be loaded first)