<?php header('content-type:text/html;charset="utf-8"'); error_reporting(0); //头部保留信息 //HoshinoTouko //2015-10-02 18:20 //引用函数 include "../functions.php"; include "../config.php"; //引用统计 include "../analysis/analysis.php"; Analysis(); //analysisMAC($MACMD5); $bookID = isset($_GET['id']) ? intval($_GET['id']) : -1; $MACMD5 = isset($_GET['mac']) ? intval($_GET['mac']) : 0; if ($bookID === -1) { $dieObj = array("error" => "NoID"); echo json_encode($dieObj); die; } //main $galleryDetail = getGalleryDetailById($bookID); $recommend = getGalleryInfo('http://nhentai.net/g/' . $bookID); $galleryOutput = array("Detail" => $galleryDetail, "Recommend" => $recommend); $temp = json_encode($galleryOutput, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); echo urldecode($temp);
print "0"; exit; } foreach ($master as $ip => $jf) { if (in_array($jf, $g_site_arr) == false) { continue; } if ($nTime == 0) { $key = $ip; } else { $key = $ip . "_" . $nTime; } $msg = $redis->get($key); if ($msg != NULL) { $xmlMsg = simplexml_load_string($msg); $ip_msg[$ip] = Analysis($xmlMsg); } if (array_key_exists($jf, $jf_arr) == false) { $jf_num[$jf] = 0; } $jf_arr[$jf][$jf_num[$jf]] = $ip; $jf_num[$jf] += 1; } $result_arr = array(); foreach ($jf_arr as $jf => $arr) { if (array_key_exists($jf, $result_arr) == false) { $result_arr[$jf] = array(); } foreach ($arr as $index => $ip) { if (array_key_exists($ip, $ip_msg) == false) { $result_arr[$jf][$ip] = "";
define('_END_TAIL', 'DONEDONEDONE'); $recv_msg_arr = array(); $serv = new swoole_server(_SERVER_IP, _SERVER_PORT); $serv->on('connect', function ($serv, $fd) { echo "Connect : " . $fd . "\n"; $recv_msg_arr[$fd] = ""; }); $serv->on('receive', function ($serv, $fd, $from_id, $data) { $serv->send($fd, "ok"); global $recv_msg_arr; if (strlen($data) < 20) { if (strcmp($data, _START_HEAD) == 0) { $recv_msg_arr[$fd] = ""; } if (strcmp($data, _END_TAIL) == 0) { Analysis($recv_msg_arr[$fd]); $recv_msg_arr[$fd] = ""; } } else { if (array_key_exists($fd, $recv_msg_arr) == true) { $recv_msg_arr[$fd] = $recv_msg_arr[$fd] . $data; } } }); $serv->on('close', function ($serv, $fd) { echo "Client " . $fd . " : Close.\n"; $recv_msg_arr[$fd] = ""; unset($recv_msg_arr[$fd]); }); $serv->start(); function Analysis($data)