From 8545b89d95fdc4e47000d267cdbeecf96d919182 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 11 Jan 2019 09:17:26 +0100 Subject: [PATCH] log file pointer can be set by calling a method --- SeedDMS_Core/Core/inc.DBAccessPDO.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.DBAccessPDO.php b/SeedDMS_Core/Core/inc.DBAccessPDO.php index ce1efd7bc..710a578fc 100644 --- a/SeedDMS_Core/Core/inc.DBAccessPDO.php +++ b/SeedDMS_Core/Core/inc.DBAccessPDO.php @@ -222,12 +222,21 @@ class SeedDMS_Core_DatabaseAccess { * Destructor of SeedDMS_Core_DatabaseAccess */ function __destruct() { /* {{{ */ - if($this->_logfp) { + if($this->_logfile && $this->_logfp) { fwrite($this->_logfp, microtime()." END --------------------------------------------\n"); 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 *