X-Git-Url: http://andersk.mit.edu/gitweb/sql-web.git/blobdiff_plain/997305cf93cd27c51f44a2e882238f190ad17606..c89e58193dd582a44c65261bc4a32bae5341afda:/mitsql.cfg.php diff --git a/mitsql.cfg.php b/mitsql.cfg.php index ad086c0..5b69b66 100755 --- a/mitsql.cfg.php +++ b/mitsql.cfg.php @@ -2,33 +2,43 @@ /* mitsql.cfg.php (c) 2005 Joe Presbrey - written for SIPB/MIT SQL service */ -define('DEBUG', 0); -define('DEVEL', 1); -define('VERSION', '0.2-dev'); +$CWD = getcwd(); +chdir(dirname(__FILE__)); + +file_exists('server.cfg.php') && require('server.cfg.php'); +defined('DEBUG') || define('DEBUG', 0); +defined('DEVEL') || define('DEVEL', 0); + +define('VER', '0.3'); +if (DEVEL) { + define('VERSION', VER.'-dev'); +} else { + define('VERSION', VER); +} define('DELIMETER', '+'); +defined('DBHOST') || define('DBHOST', 'sql.mit.edu'); +defined('BASE_URL') || define('BASE_URL', '/~sql/main/'); +defined('ADMINUSER') || define('ADMINUSER', 'root'); +defined('ADMINPASS') || define('ADMINPASS', base64_decode('TXlCZWF0c1Bvc3RA')); +defined('ADMINDB') || define('ADMINDB', 'mitsql'); -define('HOST', 'localhost'); -define('ADMINUSER', 'root'); -//define('ADMINPASS', base64_decode('TXlCZWF0c1Bvc3RA')); -define('ADMINPASS', ''); -define('ADMINDB', 'mitsql'); +$BASE_PATH = dirname(__FILE__).'/'; set_time_limit(0); ignore_user_abort(1); import_request_variables('cgp', 'i_'); DEVEL && ini_set('display_errors', 1); DEVEL && error_reporting(E_ALL); -set_include_path(get_include_path() . PATH_SEPARATOR . 'lib/'); +set_include_path(get_include_path() . PATH_SEPARATOR . $BASE_PATH . 'lib/' . PATH_SEPARATOR . $BASE_PATH); require_once('defaults.cfg.php'); -$BASE_URL = isset($_SERVER['SCRIPT_NAME'])?dirname($_SERVER['SCRIPT_NAME']).'/':''; - -$cxn = mysql_connect(HOST, ADMINUSER, ADMINPASS); +$cxn = mysql_connect(DBHOST, ADMINUSER, ADMINPASS); mysql_select_db(ADMINDB,$cxn); +if (mysql_error()) die(mysql_error()); +chdir($CWD); ?>