get(); } return DB::db()->get(); } // 에러 메세지 출력 function Error($message, $url="") { global $setup, $connect, $dir, $config_dir; include "error.php"; if($connect) @MYDB_close($connect); exit; } // 게시판의 생성유무 검사 function isTable($connect, $str, $dbname='') { if(!$dbname) { $f=@file("d_setting/DB.php") or Error("DB.php파일이 없습니다. DB설정을 먼저 하십시요"); for($i=1;$i<=4;$i++) $f[$i]=str_replace("\n","",$f[$i]); $dbname=$f[4]; } $result = MYDB_list_tables($dbname, $connect) or Error(__LINE__." : list_table error : ".MYDB_error($connect),""); $cnt = MYDB_num_rows($result); for($i=0; $i < $cnt; $i++) { $tablename = MYDB_fetch_row($result); if($str == $tablename[0]) return 1; } return 0; } function MessageBox($str) { echo ""; } function PrintElapsedTime() { global $_startTime; $_endTime = round(microtime(true) - $_startTime, 3); echo "
경과시간 : {$_endTime}초
"; } function LogText($prefix, $variable){ $fp = fopen('logs/dbg_logs.txt', 'a+'); if($fp == false){ $directory_name = dirname('logs/dbg_logs.txt'); if(!is_dir($directory_name)){ mkdir($directory_name); $fp = fopen('logs/dbg_logs.txt', 'a+'); } } fwrite($fp, sprintf('%s : %s'."\n", $prefix, var_export($_POST, true))); fclose($fp); } if(isset($_POST) && count($_POST) > 0){ LogText($_SERVER['REQUEST_URI'], $_POST); } extract($_POST, EXTR_SKIP); //XXX: $_POST를 추출 없이 그냥 쓰는 경우가 많아서 일단 디버깅을 위해 씀!!!! 절대 production 서버에서 사용 금지! //todo: $_POST로 제공되는 데이터를 각 페이지마다 분석할것.