X-Git-Url: http://andersk.mit.edu/gitweb/sql-web.git/blobdiff_plain/b44496e6b4c4b4a9e0b97d4b9488fe107ba2d480..c89e58193dd582a44c65261bc4a32bae5341afda:/mitsql.cfg.php diff --git a/mitsql.cfg.php b/mitsql.cfg.php index a534a8a..5b69b66 100755 --- a/mitsql.cfg.php +++ b/mitsql.cfg.php @@ -2,9 +2,11 @@ /* mitsql.cfg.php (c) 2005 Joe Presbrey - written for SIPB/MIT SQL service */ +$CWD = getcwd(); +chdir(dirname(__FILE__)); + file_exists('server.cfg.php') && require('server.cfg.php'); defined('DEBUG') || define('DEBUG', 0); defined('DEVEL') || define('DEVEL', 0); @@ -18,19 +20,19 @@ if (DEVEL) { 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'); $BASE_PATH = dirname(__FILE__).'/'; -$BASE_URL = isset($_SERVER['SCRIPT_NAME'])?dirname($_SERVER['SCRIPT_NAME']).'/':''; 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 . $BASE_PATH . 'lib/'); +set_include_path(get_include_path() . PATH_SEPARATOR . $BASE_PATH . 'lib/' . PATH_SEPARATOR . $BASE_PATH); require_once('defaults.cfg.php'); @@ -38,4 +40,5 @@ $cxn = mysql_connect(DBHOST, ADMINUSER, ADMINPASS); mysql_select_db(ADMINDB,$cxn); if (mysql_error()) die(mysql_error()); +chdir($CWD); ?>