diff --git a/app/common/library/DataBase.php b/app/common/library/DataBase.php deleted file mode 100644 index e2c4797..0000000 --- a/app/common/library/DataBase.php +++ /dev/null @@ -1,59 +0,0 @@ -exec($line); - } catch (\Throwable $th) { - Log::info($th->getMessage()); - } - } - } - } - - /** - * 获取数据库文件表名 - * @param string $sqlFile - * @return array - */ - public static function getSqlTables(string $sqlFile): array - { - $regex = "/^CREATE\s+TABLE\s+(IF\s+NOT\s+EXISTS\s+)?`?([a-zA-Z_]+)`?/mi"; - $tables = []; - if (is_file($sqlFile)) { - preg_match_all($regex, file_get_contents($sqlFile), $matches); - if (isset($matches[2])) { - foreach ($matches[2] as $match) { - $tables[] = str_replace('__PREFIX__', get_env('DATABASE_PREFIX'), $match); - } - } - } - - return $tables; - } -} \ No newline at end of file