2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Added debug ability

This commit is contained in:
azammitdcarf
2009-05-26 01:28:14 +00:00
parent f6d2496bd9
commit 84652b4994
2 changed files with 16 additions and 2 deletions

View File

@@ -159,5 +159,9 @@ if (!defined('LDB_HOST')) define('LDB_HOST', DB_HOST);
if (!defined('LDB_NAME')) define('LDB_NAME', DB_NAME);
if (!defined('LDB_TYPE')) define('LDB_TYPE', DB_TYPE);
/**
* Debugging
*/
if (!defined('DEBUG')) define('DEBUG',false);
?>

View File

@@ -52,6 +52,16 @@ if (!(include_once(ADODB_PATH . 'session/adodb-session2.php')))
print "<p>ERROR: Please modify config.inc.php for ADODB_PATH to point to your ADODb installation</p>";
}
define('ADODB_OUTP',"outputDebug");
/**
* Output for debugging
*/
function outputDebug($text,$newline)
{
error_log($text,0);
}
//if PEAR not installed:
set_include_path("."); //TEMP ONLY
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__).'/include/pear/');
@@ -60,13 +70,13 @@ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__).'/inclu
$db = newADOConnection(DB_TYPE);
$db->Connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$db->SetFetchMode(ADODB_FETCH_ASSOC);
if (DEBUG == true) $db->debug = true;
//global database variable for limesurvey
$ldb = newADOConnection(LDB_TYPE);
$ldb->Connect(LDB_HOST, LDB_USER, LDB_PASS, LDB_NAME);
$ldb->SetFetchMode(ADODB_FETCH_ASSOC);
if (DEBUG == true) $ldb->debug = true;
//store session in database (see sessions2 table)
ADOdb_Session::config(DB_TYPE, DB_HOST, DB_USER, DB_PASS, DB_NAME,$options=false);