j_install_db 초기화 코드 정리

This commit is contained in:
2024-05-17 18:11:56 +00:00
parent 47a4144757
commit 84b0b69b67
2 changed files with 26 additions and 23 deletions
+3 -7
View File
@@ -8,7 +8,7 @@ class ResetHelper{
}
static public function clearDB(?\MeekroDB $db = null, ?string $prefix = null):array{
static public function clearDB():array{
$servRoot = realpath(__DIR__.'/../');
if(!file_exists($servRoot.'/logs') || !file_exists($servRoot.'/data')){
@@ -72,15 +72,11 @@ class ResetHelper{
}
}
if($prefix === null){
$prefix = DB::prefix();
}
$prefix = DB::prefix();
ServConfig::getServerList()[$prefix]->closeServer();
if($db === null){
$db = DB::db();
}
$db = DB::db();
$mysqli_obj = $db->get();
$serverID = $prefix.'_'.date("ymd").'_'.Util::randomStr(4);