From 15368b70b7455266dbb81675978687ba63b95786 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 17 Feb 2015 07:55:24 +0000 Subject: [PATCH] use error_log instead of echo to give constant feedback (echo uses output buffering) and set fs_content in all rows to NULL, as it is a lot quicker --- phpgwapi/inc/class.sqlfs_utils.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.sqlfs_utils.inc.php b/phpgwapi/inc/class.sqlfs_utils.inc.php index 9995c9b00a..67a93cbb48 100644 --- a/phpgwapi/inc/class.sqlfs_utils.inc.php +++ b/phpgwapi/inc/class.sqlfs_utils.inc.php @@ -24,7 +24,7 @@ class sqlfs_utils extends sqlfs_stream_wrapper * * @param boolean $debug true to echo a message for each copied file */ - static function migrate_db2fs($debug=false) + static function migrate_db2fs($debug=true) { if (!is_object(self::$pdo)) { @@ -79,7 +79,7 @@ class sqlfs_utils extends sqlfs_stream_wrapper { throw new egw_exception_assertion_failed(__METHOD__."(): fs_id=$fs_id ($fs_name) $bytes bytes copied != size of $fs_size bytes!"); } - if ($debug) echo "$fs_id: $fs_name: $bytes bytes copied to fs\n"; + if ($debug) error_log("$fs_id: $fs_name: $bytes bytes copied to fs"); fclose($dest); fclose($content); unset($content); @@ -94,7 +94,7 @@ class sqlfs_utils extends sqlfs_stream_wrapper if ($n) // delete all content in DB, if there was some AND no error (exception thrown!) { - $query = 'UPDATE '.self::TABLE.' SET fs_content=NULL WHERE fs_content IS NOT NULL'; + $query = 'UPDATE '.self::TABLE.' SET fs_content=NULL'; $stmt = self::$pdo->prepare($query); $stmt->execute(); }