sql 파일 을 불러오는 동작을 잘못 수행하는 점 해결리
This commit is contained in:
@@ -124,9 +124,7 @@ $rootDB->error_handler = 'dbSQLFail';
|
|||||||
$mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.
|
$mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/common_schema.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/common_schema.sql'))){
|
||||||
do{
|
while ($mysqli_obj->next_result()) {;}
|
||||||
$mysqli_obj->store_result();
|
|
||||||
} while($mysqli_obj->next_result());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$rootDB->insert('system', array(
|
$rootDB->insert('system', array(
|
||||||
|
|||||||
+33
-22
@@ -12,23 +12,41 @@ if($session->userGrade < 5){
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$turnterm = Util::toInt(Util::array_get($_POST['turnterm']));
|
$v = new Validator($_POST);
|
||||||
$sync = Util::toInt(Util::array_get($_POST['sync']));
|
$v->rule('required', [
|
||||||
$scenario = Util::toInt(Util::array_get($_POST['scenario']));
|
'turnterm',
|
||||||
$fiction = Util::toInt(Util::array_get($_POST['fiction']));
|
'sync',
|
||||||
$extend = Util::toInt(Util::array_get($_POST['extend']));
|
'scenario',
|
||||||
$npcmode = Util::toInt(Util::array_get($_POST['npcmode']));
|
'fiction',
|
||||||
$show_img_level = Util::toInt(Util::array_get($_POST['show_img_level']));
|
'extend',
|
||||||
|
'npcmode',
|
||||||
|
'show_img_level'
|
||||||
|
])->rule('integer', [
|
||||||
if($turnterm===null || $sync===null || $scenario===null || $fiction===null || $extend===null || $npcmode===null || $show_img_level===null){
|
'turnterm',
|
||||||
|
'sync',
|
||||||
|
'scenario',
|
||||||
|
'fiction',
|
||||||
|
'extend',
|
||||||
|
'npcmode',
|
||||||
|
'show_img_level'
|
||||||
|
]);
|
||||||
|
if(!$v->validate()){
|
||||||
|
$errors = array_values((array)$v->errors());
|
||||||
|
$errors = array_map(function($value){return join(', ', $value);}, $errors);
|
||||||
|
$errors = join(', ', $errors);
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'입력 값이 올바르지 않습니다'
|
'reason'=>$errors
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$turnterm = (int)$_POST['turnterm'];
|
||||||
|
$sync = (int)$_POST['sync'];
|
||||||
|
$scenario = (int)$_POST['scenario'];
|
||||||
|
$fiction = (int)$_POST['fiction'];
|
||||||
|
$extend = (int)$_POST['extend'];
|
||||||
|
$npcmode = (int)$_POST['npcmode'];
|
||||||
|
$show_img_level = (int)$_POST['show_img_level'];
|
||||||
|
|
||||||
if(120 % $turnterm != 0){
|
if(120 % $turnterm != 0){
|
||||||
Json::die([
|
Json::die([
|
||||||
@@ -39,20 +57,13 @@ if(120 % $turnterm != 0){
|
|||||||
|
|
||||||
$mysqli_obj = DB::db()->get();
|
$mysqli_obj = DB::db()->get();
|
||||||
|
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
||||||
do{
|
while ($mysqli_obj->next_result()) {;}
|
||||||
if(!$mysqli_obj->store_result()){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while($mysqli_obj->next_result());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/schema.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/schema.sql'))){
|
||||||
do{
|
while ($mysqli_obj->next_result()) {;}
|
||||||
if(!$mysqli_obj->store_result()){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while($mysqli_obj->next_result());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:script
|
//TODO:script
|
||||||
|
|||||||
@@ -30,11 +30,7 @@ if($fullReset && class_exists('\\sammo\\DB')){
|
|||||||
$mysqli_obj = DB::db()->get();
|
$mysqli_obj = DB::db()->get();
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
||||||
do{
|
while ($mysqli_obj->next_result()) {;}
|
||||||
if(!$mysqli_obj->store_result()){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while($mysqli_obj->next_result());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user