From 0ba7b79f6fa1825c3367a4933cdf25ae92bb9566 Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 24 Nov 2025 14:34:32 +0800 Subject: [PATCH] * [perf] Move getDatabaseCharsetAndCollation() call outside the foreach loop to improve performance. --- module/install/model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/install/model.php b/module/install/model.php index db20fbbbd0..7ecc152b44 100644 --- a/module/install/model.php +++ b/module/install/model.php @@ -123,8 +123,9 @@ class installModel extends model { $this->dbh->useDB($this->config->db->name); - $dbFile = $this->app->getAppRoot() . 'db' . DS . 'zentao.sql'; - $tables = explode(';', file_get_contents($dbFile)); + $dbCharset = $this->dbh->getDatabaseCharsetAndCollation($this->config->db->name); + $dbFile = $this->app->getAppRoot() . 'db' . DS . 'zentao.sql'; + $tables = explode(';', file_get_contents($dbFile)); foreach($tables as $table) {