From 0b8e91efe87f4d377c948b8429b8a96e59113fd5 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Fri, 17 May 2024 17:50:07 +0000 Subject: [PATCH] =?UTF-8?q?=EC=84=A4=EC=B9=98=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- f_install/j_setup_db.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/f_install/j_setup_db.php b/f_install/j_setup_db.php index a9006ecc..96471480 100644 --- a/f_install/j_setup_db.php +++ b/f_install/j_setup_db.php @@ -150,20 +150,12 @@ if (!file_exists(ROOT . '/d_setting/.htaccess')) { $rootDB = new \MeekroDB($host, $username, $password, $dbName, $port, 'utf8mb4'); $rootDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true; -$rootDB->throw_exception_on_nonsql_error = false; -$rootDB->nonsql_error_handler = function ($params) { +$rootDB->addHook('run_failed', function ($args) { Json::die([ 'result' => false, - 'reason' => 'DB 접속에 실패했습니다.' + 'reason' => '에러.'. $args['error'] ]); -}; - -$rootDB->error_handler = function ($params) { - Json::die([ - 'result' => false, - 'reason' => 'SQL을 제대로 실행하지 못했습니다. DB상태를 확인해 주세요.' - ]); -}; +}); $mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.