* [perf] Move getDatabaseCharsetAndCollation() call outside the foreach loop to improve performance.

This commit is contained in:
liugang
2025-12-02 16:44:32 +08:00
committed by sunhao
parent 88c299d96a
commit 0ba7b79f6f
+3 -2
View File
@@ -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)
{