init(); } $body = unserialize($body); $type = $body['type']; Log::record("onRequest : {$type}",Log::DEBUG); if($type == self::GetRelatedWord) { $words = $body['keyword']; $result = searcher::instance()->get_word($words); $data = serialize($result); } elseif($type == self::SearchReasult) { $params = $body['params']; $result = searcher::instance()->get_result($params); $data = serialize($result); } elseif($type == self::MatchPrice) { $params = $body['params']; $result = searcher::instance()->match_price($params); $data = serialize($result); } elseif($type == self::PromoteGoods) { $params = $body['params']; $result = searcher::instance()->promote_goods($params); $data = serialize($result); } elseif ($type == self::ValidateArea) { $params = $body['params']; $area_id = $params['area_id']; $result = area_library::instance()->country($area_id); if($result == false) { $data = serialize(['result' => false]); } else { $result['result'] = true; $data = serialize($result); } } else { ob_clean(); return false; } process_looper::instance()->write($bufid,$data); return true; } public function onClose($bufid) { } }