util 클래스 명을 PSR1에 맞게 Util로 재 명명

This commit is contained in:
2018-03-24 21:31:31 +09:00
parent 002f9ba6cf
commit b5cba27df9
26 changed files with 110 additions and 110 deletions
+13 -13
View File
@@ -8,14 +8,14 @@ include "func.php";
//로그인 검사
$isgen = util::array_get($_POST['isgen'], '');
$tech1 = util::array_get($_POST['tech1'], 0);
$tech2 =util::array_get($_POST['tech2'], 0);
$dex10 = util::array_get($_POST['dex10'], 0);
$dex110 = util::array_get($_POST['dex110'], 0);
$dex120 = util::array_get($_POST['dex120'], 0);
$dex130 = util::array_get($_POST['dex130'], 0);
$dex140 = util::array_get($_POST['dex140'], 0);
$isgen = Util::array_get($_POST['isgen'], '');
$tech1 = Util::array_get($_POST['tech1'], 0);
$tech2 =Util::array_get($_POST['tech2'], 0);
$dex10 = Util::array_get($_POST['dex10'], 0);
$dex110 = Util::array_get($_POST['dex110'], 0);
$dex120 = Util::array_get($_POST['dex120'], 0);
$dex130 = Util::array_get($_POST['dex130'], 0);
$dex140 = Util::array_get($_POST['dex140'], 0);
$dx10 = array_fill(0, 20, '');
$dx110 = array_fill(0, 20, '');
@@ -23,11 +23,11 @@ $dx120 = array_fill(0, 20, '');
$dx130 = array_fill(0, 20, '');
$dx140 = array_fill(0, 20, '');
$dex20 = util::array_get($_POST['dex20'], 0);
$dex210 = util::array_get($_POST['dex210'], 0);
$dex220 = util::array_get($_POST['dex220'], 0);
$dex230 = util::array_get($_POST['dex230'], 0);
$dex240 = util::array_get($_POST['dex240'], 0);
$dex20 = Util::array_get($_POST['dex20'], 0);
$dex210 = Util::array_get($_POST['dex210'], 0);
$dex220 = Util::array_get($_POST['dex220'], 0);
$dex230 = Util::array_get($_POST['dex230'], 0);
$dex240 = Util::array_get($_POST['dex240'], 0);
$dx20 = array_fill(0, 20, '');
$dx210 = array_fill(0, 20, '');
+4 -4
View File
@@ -54,7 +54,7 @@ function getGeneralID($forceExit=false, $countLogin=true){
}
$idKey = getServPrefix().'p_no';
$generalID = util::array_get($_SESSION[$idKey], null);
$generalID = Util::array_get($_SESSION[$idKey], null);
if($generalID){
return $generalID;
@@ -75,7 +75,7 @@ function getGeneralID($forceExit=false, $countLogin=true){
$query=$db->query("update general set logcnt=logcnt+1 ,ip = %s_ip,lastconnect=%s_lastConnect,conmsg=%s_conmsg where owner= %s_userID",[
'ip' => getenv("REMOTE_ADDR"),
'lastConnect' => date('Y-m-d H:i:s'),
'conmsg' => util::array_get($_SESSION['conmsg'], ''),
'conmsg' => Util::array_get($_SESSION['conmsg'], ''),
'userID' => $userID
]);
$_SESSION[$idKey] = $generalID;
@@ -102,7 +102,7 @@ function getGeneralName($forceExit=false)
}
$nameKey = getServPrefix().'p_name';
$generalName = util::array_get($_SESSION[$nameKey], null);
$generalName = Util::array_get($_SESSION[$nameKey], null);
if($generalName){
return $generalName;
@@ -1797,7 +1797,7 @@ function increaseRefresh($type="", $cnt=1) {
getDB()->query('UPDATE game set refresh=refresh+%i where `no`=1', $cnt);
if(!util::array_get($_SESSION['userID'], null)) {
if(!Util::array_get($_SESSION['userID'], null)) {
getDB()->query('UPDATE general set `lastrefresh`=%s_date, `con`=`con`+%i_cnt, `connect`=`connect`+%i_cnt, refcnt=refcnt+%i_cnt, refresh=refresh+%i_cnt where `no`=%i_no',[
'date'=>$date,
'cnt'=>$cnt,
+7 -7
View File
@@ -116,13 +116,13 @@ function sendRawMessage($msgType, $isSender, $mailbox, $src, $dest, $msg, $date,
$srcNation = getNationStaticInfo($src['nation_id']);
$destNation = getNationStaticInfo($dest['nation_id']);
$src['nation'] = util::array_get($srcNation['name'], '재야');
$src['color'] = util::array_get($srcNation['color'], '#ffffff');
$src['nation'] = Util::array_get($srcNation['name'], '재야');
$src['color'] = Util::array_get($srcNation['color'], '#ffffff');
$dest['nation'] = util::array_get($destNation['name'], '재야');
$dest['color'] = util::array_get($destNation['color'], '#ffffff');
$dest['nation'] = Util::array_get($destNation['name'], '재야');
$dest['color'] = Util::array_get($destNation['color'], '#ffffff');
if(!$isSender && $mailBox < 9000 && util::array_get($msgOption['alert'], false)){
if(!$isSender && $mailBox < 9000 && Util::array_get($msgOption['alert'], false)){
//TODO:newmsg보단 lastmsg로 datetime을 넣는게 더 나아보임
getDB()->update('general', array(
'newmsg' => true
@@ -207,7 +207,7 @@ function sendScoutMsg($src, $dest, $date) {
}
$nation = getNationStaticInfo($src['nation_id']);
$nationName = util::array_get($nation['name'], '재야');
$nationName = Util::array_get($nation['name'], '재야');
if(!$dest || !$dest['id']){
return false;
@@ -260,7 +260,7 @@ function getMailboxList(){
$mailbox = $nationID + 9000;
$nation = $nation['name'];
$color = ('#'.$nation['color']).replace('##','#');//xxx: #기호 없는 이전 코드 대비용
$generals = util::array_get($generalNations[$nationID], []);
$generals = Util::array_get($generalNations[$nationID], []);
return [
"nationID"=>$nationID,
+2 -2
View File
@@ -44,10 +44,10 @@ function process_22($connect, &$general) {
sendScoutMsg([
'id' => $general['no'],
'nation_id' => util::array_get($general['nation'], 0)
'nation_id' => Util::array_get($general['nation'], 0)
],[
'id' => $you['no'],
'nation_id' => util::array_get($you['nation'], 0)
'nation_id' => Util::array_get($you['nation'], 0)
],$date);
$general['intel2']++;
+1 -1
View File
@@ -10,7 +10,7 @@ session_write_close(); // 이제 세션 안 쓴다
$jsonPost = parseJsonPost();
$reqSequence = toInt(util::array_get($jsonPost['sequence'], 0));
$reqSequence = toInt(Util::array_get($jsonPost['sequence'], 0));
$nationID = getDB()->queryFirstField(
+1 -1
View File
@@ -12,7 +12,7 @@ if($session->userGrade < 5){
]);
}
$scenarioIdx = toInt(util::array_get($_GET['scenarioIdx']));
$scenarioIdx = toInt(Util::array_get($_GET['scenarioIdx']));
if($scenarioIdx === null){
Json::die([
+4 -4
View File
@@ -19,8 +19,8 @@ session_write_close(); // 이제 세션 안 쓴다
$jsonPost = parseJsonPost();
$msgID = toInt(util::array_get($jsonPost['msgID'], null), false);
$msgResponse = util::array_get($jsonPost['response'], null);
$msgID = toInt(Util::array_get($jsonPost['msgID'], null), false);
$msgResponse = Util::array_get($jsonPost['response'], null);
if ($msgID === null || !is_bool($msgResponse)) {
Json::die([
@@ -60,8 +60,8 @@ if ($validUntil < $date) {
]);
}
$msgOption = json_decode(util::array_get($messageInfo['option'], '{}'));
$msgAction = util::array_get($msgOption['action'], null);
$msgOption = json_decode(Util::array_get($messageInfo['option'], '{}'));
$msgAction = Util::array_get($msgOption['action'], null);
$messageInfo['option'] = $msgOption;
$msgSrc = json_decode($messageInfo['src']);
+1 -1
View File
@@ -120,7 +120,7 @@ if($destMailbox == 9999) {
// 개인 메세지
} elseif($destMailbox > 0) {
$last_msg = new DateTime(util::array_get($_SESSION['last_msg'], '0000-00-00'));
$last_msg = new DateTime(Util::array_get($_SESSION['last_msg'], '0000-00-00'));
$msg_interval = $datetime->getTimestamp() - $last_msg->getTimestamp();
//NOTE: 여기서 유저 레벨을 구별할 코드가 필요할까?
+4 -4
View File
@@ -8,12 +8,12 @@ include "func.php";
$name = $_POST['name'];
$name = StringUtil::NoSpecialCharacter($name);
$pic = util::array_get($_POST['pic'],'');
$pic = Util::array_get($_POST['pic'],'');
$character = $_POST['character'];
$leader = util::array_get($_POST['leader'], 50);
$power = util::array_get($_POST['power'], 50);
$intel = util::array_get($_POST['intel'], 50);
$leader = Util::array_get($_POST['leader'], 50);
$power = Util::array_get($_POST['power'], 50);
$intel = Util::array_get($_POST['intel'], 50);
$mylog = [];
+2 -2
View File
@@ -101,7 +101,7 @@ session_cache_limiter('nocache, must_revalidate');//NOTE: 캐시가 가능하도
session_start();
//첫 등장
if(!util::array_get($_SESSION['p_ip'], null)) {
if(!Util::array_get($_SESSION['p_ip'], null)) {
$_SESSION['p_ip'] = getenv("REMOTE_ADDR");
$_SESSION['p_time'] = time();
}
@@ -278,7 +278,7 @@ function dictToArray($dict, $keys){
$result = [];
foreach($keys as $key){
$result[] = util::array_get($dict[$key], null);
$result[] = Util::array_get($dict[$key], null);
}
return $result;
}
+4 -4
View File
@@ -12,10 +12,10 @@ if(Session::getUserGrade(true) < 5){
if(file_exists("d_setting/conf.php")) error("이미 conf.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
$hostname = util::array_get($_POST['hostname'], '');
$user_id = util::array_get($_POST['user_id'], '');
$password = util::array_get($_POST['password'], '');
$dbname = util::array_get($_POST['dbname'], '');
$hostname = Util::array_get($_POST['hostname'], '');
$user_id = Util::array_get($_POST['user_id'], '');
$password = Util::array_get($_POST['password'], '');
$dbname = Util::array_get($_POST['dbname'], '');
// 호스트네임, 아이디, DB네임, 비밀번호의 공백여부 검사
if(isBlank($hostname)) Error("HostName을 입력하세요","");
+7 -7
View File
@@ -4,13 +4,13 @@ include "func.php";
$turnterm = util::array_get($_POST['turnterm'],'0');
$sync = util::array_get($_POST['sync'],'0');
$scenario = util::array_get($_POST['scenario'],'0');
$fiction = util::array_get($_POST['fiction'],'0');
$extend = util::array_get($_POST['extend'],'0');
$npcmode = util::array_get($_POST['npcmode'],'0');
$img = util::array_get($_POST['img'],'0');
$turnterm = Util::array_get($_POST['turnterm'],'0');
$sync = Util::array_get($_POST['sync'],'0');
$scenario = Util::array_get($_POST['scenario'],'0');
$fiction = Util::array_get($_POST['fiction'],'0');
$extend = Util::array_get($_POST['extend'],'0');
$npcmode = Util::array_get($_POST['npcmode'],'0');
$img = Util::array_get($_POST['img'],'0');
if(Session::getUserGrade(true) < 5){
die('관리자 아님');