]> git.mxchange.org Git - friendica.git/blobdiff - include/dba.php
Merge pull request #2744 from tobiasd/20160820-cal
[friendica.git] / include / dba.php
index c66723033c1965c6251cd837fdba3c0f5f43276b..b0927265be9006e24bc16e368b86763ae690bb23 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+require_once("dbm.php");
 
 # if PDO is avaible for mysql, use the new database abstraction
 # TODO: PDO is disabled for release 3.3. We need to investigate why
@@ -14,8 +15,7 @@ if(class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) {
 require_once('include/datetime.php');
 
 /**
- *
- * MySQL database class
+ * @class MySQL database class
  *
  * For debugging, insert 'dbg(1);' anywhere in the program flow.
  * dbg(0); will turn it off. Logging is performed at LOGGER_DATA level.
@@ -107,6 +107,9 @@ class dba {
 
                $a->save_timestamp($stamp1, "database");
 
+               if (strtolower(substr($sql, 0, 6)) != "select")
+                       $a->save_timestamp($stamp1, "database_write");
+
                if(x($a->config,'system') && x($a->config['system'],'db_log')) {
                        if (($duration > $a->config["system"]["db_loglimit"])) {
                                $duration = round($duration, 3);
@@ -341,4 +344,3 @@ function dbesc_array(&$arr) {
 function dba_timer() {
        return microtime(true);
 }
-