prevent recursion in the database driver when debugging is enabled and the system config is not yet loaded - caused by calling get_config and making db calls within the logger function; which we then attempt to log...

This commit is contained in:
redmatrix
2016-05-09 01:12:24 -07:00
parent 94accd8a4c
commit 6f486a3393
4 changed files with 26 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ class dba_postgres extends dba_driver {
$this->error = pg_last_error($this->db);
if($result === false || $this->error) {
//logger('dba_postgres: ' . printable($sql) . ' returned false.' . "\n" . $this->error);
//db_logger('dba_postgres: ' . printable($sql) . ' returned false.' . "\n" . $this->error);
if(file_exists('dbfail.out'))
file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND);
}
@@ -67,7 +67,7 @@ class dba_postgres extends dba_driver {
$r[] = $x;
pg_free_result($result);
if($this->debug)
logger('dba_postgres: ' . printable(print_r($r,true)));
db_logger('dba_postgres: ' . printable(print_r($r,true)));
}
return $r;
}