Changeset 50 for branches/old/global.php


Ignore:
Timestamp:
Feb 20, 2015, 8:54:42 AM (10 years ago)
Author:
chronos
Message:
  • Modified: Show graph, table and other controls horizontally centered.
  • Added: Check for existence of config file.
  • Added: Check if database is accessible.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/old/global.php

    r49 r50  
    22
    33session_start();
     4$FileName = dirname(__FILE__).'/config.php';
     5if(file_exists($FileName)) include($FileName);
     6else {
     7  die('Configuration file "'.$FileName.'" not found.');
     8}
    49include_once('config.php');
    510include_once('database.php');
     
    914include_once('stat_functions.php');
    1015$Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
     16if ($Database->connect_error) {
     17  die('Connect Error (' . $Database->connect_errno . ') '.$Database->connect_error);
     18}
     19
    1120$Database->Prefix = $Config['Database']['Prefix'];
    1221$Database->charset($Config['Database']['Charset']);
Note: See TracChangeset for help on using the changeset viewer.