log file pointer can be set by calling a method

This commit is contained in:
Uwe Steinmann 2019-01-11 09:17:26 +01:00
parent b049537220
commit 8545b89d95

View File

@ -222,12 +222,21 @@ class SeedDMS_Core_DatabaseAccess {
* Destructor of SeedDMS_Core_DatabaseAccess * Destructor of SeedDMS_Core_DatabaseAccess
*/ */
function __destruct() { /* {{{ */ function __destruct() { /* {{{ */
if($this->_logfp) { if($this->_logfile && $this->_logfp) {
fwrite($this->_logfp, microtime()." END --------------------------------------------\n"); fwrite($this->_logfp, microtime()." END --------------------------------------------\n");
fclose($this->_logfp); fclose($this->_logfp);
} }
} /* }}} */ } /* }}} */
/**
* Set the file pointer to a log file
*
* Once it is set, all queries will be logged into this file
*/
function setLogFp($fp) { /* {{{ */
$this->_logfp = $fp;
} /* }}} */
/** /**
* Connect to database * Connect to database
* *