function resDataProc($dbHandle, $threadData, $kind, $resStealRegex, $resBodyAnkaerLinkStealRegex, $resBodyImgLinkStealRegex, $threadOldLogedRegex, $prepareStForRI, $prepareStForTUPTR, $prepareStForTUIO, $prepareStForTUTI, $prepareStForTUNOS, $imgBaseUrl, $censorList) { $i = 0; foreach ($threadData as $value) { if ($i > 2) { break; } $encodiedResBaseHtml = resSteal($value["thread_url"]); $isoldLog = threadIsOldLog($encodiedResBaseHtml, $threadOldLogedRegex); if ($isoldLog) { threadUpdateTois_oldlog($value["thread_sha"], $prepareStForTUIO, $dbHandle); } $resData = getResArray($resStealRegex, $encodiedResBaseHtml, $value["thread_sha"]); $ankaerLinkProced = resBodyAnkaerLinkProc($resData, $resBodyAnkaerLinkStealRegex); $imgLinkProced = resBodyImgLinkProc($dbHandle, $ankaerLinkProced, $value["thread_sha"], $resBodyImgLinkStealRegex, $prepareStForTUTI, $imgBaseUrl); $censoredProced = censorShipForRes($imgLinkProced, $censorList); $net_or_sc_kind = kindChecher($censoredProced[0]["res_id"]); $resDataArray = resDataReArray($censoredProced, $net_or_sc_kind); $countOfResDataArray = count($resDataArray); //MAX RES number. resInsert($dbHandle, $resDataArray, $kind, $prepareStForRI); threadUpdateTonet_or_sc($dbHandle, $net_or_sc_kind, $value["thread_sha"], $prepareStForTUNOS); threadUpdateToRes_end($dbHandle, $value["thread_sha"], $countOfResDataArray, $prepareStForTUPTR); unset($resDataArray, $censoredProced, $imgLinkProced, $ankaerLinkProced, $encodiedResBaseHtml, $resStealBool); $i++; } unset($value); }
threadUpdateTois_oldlog($value["thread_sha"], $prepareStForTUIO, $dbHandle); } $resData = getResArray(getDiRegex(getPDO(), "resStealRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"]), $encodiedResBaseHtml, $value["thread_sha"]); if (!$resData) { continue; } $ankaerLinkProced = resBodyAnkaerLinkProc($resData, getDiRegex(getPDO(), "resBodyAnkaerLinkStealRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"])); if ($menuData["kind"] === "open2ch.net") { $imgLinkProced = resBodyImgLinkProcO(getPDO(), $ankaerLinkProced, $value["thread_sha"], getDiRegex(getPDO(), "resBodyImgLinkStealRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"]), $queryList["UPDATE_THREAD_IS_IMG"], $fixedList["imgDirUrl"], $menuData["kind"]); } else { $imgLinkProced = resBodyImgLinkProc(getPDO(), $ankaerLinkProced, $value["thread_sha"], getDiRegex(getPDO(), "resBodyImgLinkStealRegex", $menuData["kind"], $queryList["SELECT_DIREGEX"]), $queryList["UPDATE_THREAD_IS_IMG"], $fixedList["imgDirUrl"], $menuData["kind"]); } $censoredProced = censorShipForRes($imgLinkProced, $censorList); // $net_or_sc_kind = kindChecher($censoredProced[0]["res_id"]); $net_or_sc_kind = "null"; $resDataArray = resDataReArray($censoredProced, $net_or_sc_kind, $menuData["kind"]); resInsert(getPDO(), $resDataArray, $menuData["kind"], $queryList["INSERT_RES"]); threadUpdateTonet_or_sc(getPDO(), $net_or_sc_kind, $value["thread_sha"], $queryList["UPDATE_THREAD_NET_OR_SC"]); $countOfResDataArray = count($resDataArray); //MAX RES number. threadUpdateToRes_end(getPDO(), $value["thread_sha"], $countOfResDataArray, $queryList["UPDATE_THREAD_RES_END"]); unset($isoldLog, $resData, $resDataArray, $censoredProced, $imgLinkProced, $ankaerLinkProced, $encodiedResBaseHtml, $resStealBool, $countOfResDataArray, $net_or_sc_kind); $i++; } unset($value, $threadData); } } memoryPeakUse("end"); timeTest("ProcEnd"); $proc_time = timeView(); procRecode(getPDO(), $menuData["id"], $menuData["menu_title"], $proc_time, $menuData["kind"], $tags["end"], $queryList["INSERT_PROC_RECODE"]);