mirror of
				https://gitee.com/ledc/IYUUAutoReseed
				synced 2025-10-31 00:39:50 +00:00 
			
		
		
		
	检查代码缩进规范
This commit is contained in:
		| @@ -37,10 +37,10 @@ class AutoReseed | |||||||
|      */ |      */ | ||||||
|     public static $noReseed = []; |     public static $noReseed = []; | ||||||
|     /** |     /** | ||||||
| 	 * cookie检查 |      * cookie检查 | ||||||
| 	 * @var array |      * @var array | ||||||
| 	 */ |      */ | ||||||
| 	public static $cookieCheck = ['hdchina','hdcity']; |     public static $cookieCheck = ['hdchina','hdcity']; | ||||||
|     /** |     /** | ||||||
|      * 缓存路径 |      * 缓存路径 | ||||||
|      * @var string |      * @var string | ||||||
| @@ -346,247 +346,247 @@ class AutoReseed | |||||||
|     public static function call($hashArray = array()) |     public static function call($hashArray = array()) | ||||||
|     { |     { | ||||||
|         global $configALL; |         global $configALL; | ||||||
| 		$resArray = $sites = array(); |         $resArray = $sites = array(); | ||||||
| 		$curl = new Curl(); |         $curl = new Curl(); | ||||||
| 		$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); |         $curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); | ||||||
| 		// 签名 |         // 签名 | ||||||
| 		$hashArray['timestamp'] = time(); |         $hashArray['timestamp'] = time(); | ||||||
| 		// 爱语飞飞token |         // 爱语飞飞token | ||||||
| 		$hashArray['sign'] = Oauth::getSign(); |         $hashArray['sign'] = Oauth::getSign(); | ||||||
| 		$hashArray['version'] = self::VER; |         $hashArray['version'] = self::VER; | ||||||
| 		// 写请求日志 |         // 写请求日志 | ||||||
| 		if (true) { |         if (true) { | ||||||
| 			// 文件句柄 |             // 文件句柄 | ||||||
| 			$resource = fopen(self::$cacheDir.'hashString.txt', "wb"); |             $resource = fopen(self::$cacheDir.'hashString.txt', "wb"); | ||||||
| 			// 成功:返回写入字节数,失败返回false |             // 成功:返回写入字节数,失败返回false | ||||||
| 			$worldsnum = fwrite($resource, p($hashArray, false)); |             $worldsnum = fwrite($resource, p($hashArray, false)); | ||||||
| 			fclose($resource); |             fclose($resource); | ||||||
| 		} |         } | ||||||
| 		// 发起请求 |         // 发起请求 | ||||||
| 		echo "正在提交辅种信息…… \n"; |         echo "正在提交辅种信息…… \n"; | ||||||
| 		$res = $curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray); |         $res = $curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray); | ||||||
| 		$resArray = json_decode($res->response, true); |         $resArray = json_decode($res->response, true); | ||||||
| 		// 写返回日志 |         // 写返回日志 | ||||||
| 		if(true){ |         if (true) { | ||||||
| 			// 文件句柄 |             // 文件句柄 | ||||||
| 			$resource = fopen(self::$cacheDir.'reseed.txt', "wb"); |             $resource = fopen(self::$cacheDir.'reseed.txt', "wb"); | ||||||
| 			// 成功:返回写入字节数,失败返回false |             // 成功:返回写入字节数,失败返回false | ||||||
| 			$worldsnum = fwrite($resource, p($resArray, false)); |             $worldsnum = fwrite($resource, p($resArray, false)); | ||||||
| 			fclose($resource); |             fclose($resource); | ||||||
| 		} |         } | ||||||
| 		// 判断返回值 |         // 判断返回值 | ||||||
| 		if ( isset($resArray['errmsg']) && ($resArray['errmsg'] == 'ok') ) { |         if (isset($resArray['errmsg']) && ($resArray['errmsg'] == 'ok')) { | ||||||
| 			echo "辅种信息提交成功!!! \n\n"; |             echo "辅种信息提交成功!!! \n\n"; | ||||||
| 		}else{ |         } else { | ||||||
| 			$errmsg = isset($resArray['errmsg']) ? $resArray['errmsg'] : '远端服务器无响应,请稍后重试!'; |             $errmsg = isset($resArray['errmsg']) ? $resArray['errmsg'] : '远端服务器无响应,请稍后重试!'; | ||||||
| 			echo '-----辅种失败,原因:' .$errmsg. " \n\n"; |             echo '-----辅种失败,原因:' .$errmsg. " \n\n"; | ||||||
| 			exit(1); |             exit(1); | ||||||
| 		} |         } | ||||||
| 		// 可辅种站点信息 |         // 可辅种站点信息 | ||||||
| 		$sites = $resArray['sites']; |         $sites = $resArray['sites']; | ||||||
| 		#p($sites); |         #p($sites); | ||||||
| 		// 支持站点数量 |         // 支持站点数量 | ||||||
| 		self::$wechatMsg['sitesCount'] = count($sites); |         self::$wechatMsg['sitesCount'] = count($sites); | ||||||
| 		// 按客户端循环辅种 开始 |         // 按客户端循环辅种 开始 | ||||||
| 		foreach (self::$links as $k => $v) { |         foreach (self::$links as $k => $v) { | ||||||
| 			$reseed = $infohash_Dir = array(); |             $reseed = $infohash_Dir = array(); | ||||||
| 			// info_hash与下载目录对应表 |             // info_hash与下载目录对应表 | ||||||
| 			$infohash_Dir = self::$links[$k]['hash']; |             $infohash_Dir = self::$links[$k]['hash']; | ||||||
| 			#p($infohash_Dir); |             #p($infohash_Dir); | ||||||
| 			if (empty($resArray['clients_'.$k])) { |             if (empty($resArray['clients_'.$k])) { | ||||||
| 				echo "clients_".$k."没有查询到可辅种数据 \n\n"; |                 echo "clients_".$k."没有查询到可辅种数据 \n\n"; | ||||||
| 				continue; |                 continue; | ||||||
| 			}			 |             } | ||||||
| 			// 当前客户端可辅种数据 |             // 当前客户端可辅种数据 | ||||||
| 			$reseed = $resArray['clients_'.$k]; |             $reseed = $resArray['clients_'.$k]; | ||||||
| 			foreach ($reseed as $info_hash => $vv) { |             foreach ($reseed as $info_hash => $vv) { | ||||||
| 				// 当前种子哈希对应的目录 |                 // 当前种子哈希对应的目录 | ||||||
| 				$downloadDir = $infohash_Dir[$info_hash]; |                 $downloadDir = $infohash_Dir[$info_hash]; | ||||||
| 				foreach ($vv['torrent'] as $id => $value) { |                 foreach ($vv['torrent'] as $id => $value) { | ||||||
| 					$_url = $url = ''; |                     $_url = $url = ''; | ||||||
| 					$download_page = $details_url = ''; |                     $download_page = $details_url = ''; | ||||||
| 					// 匹配的辅种数据累加 |                     // 匹配的辅种数据累加 | ||||||
| 					self::$wechatMsg['reseedCount']++; |                     self::$wechatMsg['reseedCount']++; | ||||||
| 					// 站点id |                     // 站点id | ||||||
| 					$sitesID = $value['sid'];					 |                     $sitesID = $value['sid']; | ||||||
| 					// 页面规则 |                     // 页面规则 | ||||||
| 					$download_page = str_replace('{}', $value['torrent_id'], $sites[$sitesID]['download_page']); |                     $download_page = str_replace('{}', $value['torrent_id'], $sites[$sitesID]['download_page']); | ||||||
| 					$_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$download_page; |                     $_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$download_page; | ||||||
| 					/** |                     /** | ||||||
| 					 * 前置检测 |                      * 前置检测 | ||||||
| 					 */ |                      */ | ||||||
| 					// passkey检测 |                     // passkey检测 | ||||||
| 					if ( empty($configALL[$sites[$sitesID]['site']]['passkey']) ) { |                     if (empty($configALL[$sites[$sitesID]['site']]['passkey'])) { | ||||||
| 						echo '-------因当前' .$sites[$sitesID]['site']. "站点未设置passkey,已跳过!! \n\n"; |                         echo '-------因当前' .$sites[$sitesID]['site']. "站点未设置passkey,已跳过!! \n\n"; | ||||||
| 						self::$wechatMsg['reseedSkip']++; |                         self::$wechatMsg['reseedSkip']++; | ||||||
| 						continue; |                         continue; | ||||||
| 					} |                     } | ||||||
| 					// cookie检测 |                     // cookie检测 | ||||||
| 					if ( in_array($sites[$sitesID]['site'], self::$cookieCheck) && empty($configALL[$sites[$sitesID]['site']]['cookie']) ) { |                     if (in_array($sites[$sitesID]['site'], self::$cookieCheck) && empty($configALL[$sites[$sitesID]['site']]['cookie'])) { | ||||||
| 						echo '-------因当前' .$sites[$sitesID]['site']. '站点未设置cookie,已跳过!!' . "\n\n"; |                         echo '-------因当前' .$sites[$sitesID]['site']. '站点未设置cookie,已跳过!!' . "\n\n"; | ||||||
| 						self::$wechatMsg['reseedSkip']++; |                         self::$wechatMsg['reseedSkip']++; | ||||||
| 						continue; |                         continue; | ||||||
| 					} |                     } | ||||||
| 					// 流控检测 |                     // 流控检测 | ||||||
| 					if ( isset($configALL[$sites[$sitesID]['site']]['limit']) ) { |                     if (isset($configALL[$sites[$sitesID]['site']]['limit'])) { | ||||||
| 						echo "-------因当前" .$sites[$sitesID]['site']. "站点触发流控,已跳过!! {$_url} \n\n"; |                         echo "-------因当前" .$sites[$sitesID]['site']. "站点触发流控,已跳过!! {$_url} \n\n"; | ||||||
| 						self::$wechatMsg['reseedSkip']++; |                         self::$wechatMsg['reseedSkip']++; | ||||||
| 						continue; |                         continue; | ||||||
| 					} |                     } | ||||||
| 					// 重复做种检测 |                     // 重复做种检测 | ||||||
| 					if ( isset($infohash_Dir[$value['info_hash']]) ) { |                     if (isset($infohash_Dir[$value['info_hash']])) { | ||||||
| 						echo '-------与客户端现有种子重复:'.$_url."\n\n"; |                         echo '-------与客户端现有种子重复:'.$_url."\n\n"; | ||||||
| 						self::$wechatMsg['reseedRepeat']++; |                         self::$wechatMsg['reseedRepeat']++; | ||||||
| 						continue; |                         continue; | ||||||
| 					} |                     } | ||||||
| 					// 历史添加检测 |                     // 历史添加检测 | ||||||
| 					if ( is_file(self::$cacheHash . $value['info_hash'].'.txt') ) { |                     if (is_file(self::$cacheHash . $value['info_hash'].'.txt')) { | ||||||
| 						echo '-------当前种子上次辅种已成功添加,已跳过! '.$_url."\n\n"; |                         echo '-------当前种子上次辅种已成功添加,已跳过! '.$_url."\n\n"; | ||||||
| 						self::$wechatMsg['reseedPass']++; |                         self::$wechatMsg['reseedPass']++; | ||||||
| 						continue; |                         continue; | ||||||
| 					} |                     } | ||||||
| 					/** |                     /** | ||||||
| 					 * 种子URL组合方式区分 |                      * 种子URL组合方式区分 | ||||||
| 					 */ |                      */ | ||||||
| 					switch ($sites[$sitesID]['site']) { |                     switch ($sites[$sitesID]['site']) { | ||||||
| 						case 'ttg': |                         case 'ttg': | ||||||
| 							$url = $_url."/". $configALL[$sites[$sitesID]['site']]['passkey']; |                             $url = $_url."/". $configALL[$sites[$sitesID]['site']]['passkey']; | ||||||
| 							break; |                             break; | ||||||
|                         case 'm-team': |                         case 'm-team': | ||||||
|                         case 'moecat': |                         case 'moecat': | ||||||
| 							$ip_type = ''; |                             $ip_type = ''; | ||||||
| 							if (isset($configALL[$sites[$sitesID]['site']]['ip_type'])) { |                             if (isset($configALL[$sites[$sitesID]['site']]['ip_type'])) { | ||||||
| 								$ip_type = $configALL[$sites[$sitesID]['site']]['ip_type'] == 'ipv6' ? '&ipv6=1' : ''; |                                 $ip_type = $configALL[$sites[$sitesID]['site']]['ip_type'] == 'ipv6' ? '&ipv6=1' : ''; | ||||||
| 							} |                             } | ||||||
| 							$url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey'] . $ip_type. "&https=1"; |                             $url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey'] . $ip_type. "&https=1"; | ||||||
| 							break; |                             break; | ||||||
| 						default: |                         default: | ||||||
| 							$url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey']; |                             $url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey']; | ||||||
| 							break; |                             break; | ||||||
| 					} |                     } | ||||||
| 					/** |                     /** | ||||||
| 					 * 检查站点是否可以辅种 |                      * 检查站点是否可以辅种 | ||||||
| 					 */ |                      */ | ||||||
| 					// 判断是否具有VIP或特殊权限? |                     // 判断是否具有VIP或特殊权限? | ||||||
| 					$is_vip = isset($configALL[$sites[$sitesID]['site']]['is_vip']) && $configALL[$sites[$sitesID]['site']]['is_vip'] ? 1 : 0; |                     $is_vip = isset($configALL[$sites[$sitesID]['site']]['is_vip']) && $configALL[$sites[$sitesID]['site']]['is_vip'] ? 1 : 0; | ||||||
| 					if ( (in_array($sites[$sitesID]['site'], self::$noReseed)==false) || $is_vip ) { |                     if ((in_array($sites[$sitesID]['site'], self::$noReseed)==false) || $is_vip) { | ||||||
| 						/** |                         /** | ||||||
| 						 *  可以辅种 |                          *  可以辅种 | ||||||
| 						 */ |                          */ | ||||||
| 						// 特殊站点:推送给下载器种子元数据 |                         // 特殊站点:推送给下载器种子元数据 | ||||||
| 						switch ($sites[$sitesID]['site']) { |                         switch ($sites[$sitesID]['site']) { | ||||||
| 							case 'hdchina': |                             case 'hdchina': | ||||||
| 								$cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : ''; |                                 $cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : ''; | ||||||
| 								$userAgent = $configALL['default']['userAgent']; |                                 $userAgent = $configALL['default']['userAgent']; | ||||||
| 								// 拼接URL |                                 // 拼接URL | ||||||
| 								$details_page = str_replace('{}', $value['torrent_id'], 'details.php?id={}&hit=1'); |                                 $details_page = str_replace('{}', $value['torrent_id'], 'details.php?id={}&hit=1'); | ||||||
| 								$details_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$details_page; |                                 $details_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$details_page; | ||||||
| 								$details_html = download($details_url, $cookie, $userAgent); |                                 $details_html = download($details_url, $cookie, $userAgent); | ||||||
| 								print "种子详情页:".$details_url. "\n"; |                                 print "种子详情页:".$details_url. "\n"; | ||||||
| 								// 提取种子下载地址 |                                 // 提取种子下载地址 | ||||||
| 								$download_page = str_replace('{}', '', $sites[$sitesID]['download_page']); |                                 $download_page = str_replace('{}', '', $sites[$sitesID]['download_page']); | ||||||
| 								$offset = strpos($details_html, $download_page); |                                 $offset = strpos($details_html, $download_page); | ||||||
| 								$urlTemp = substr($details_html, $offset, 50); |                                 $urlTemp = substr($details_html, $offset, 50); | ||||||
| 								// 种子地址 |                                 // 种子地址 | ||||||
| 								$_url = substr($urlTemp,0,strpos($urlTemp,'">')); |                                 $_url = substr($urlTemp, 0, strpos($urlTemp, '">')); | ||||||
| 								$_url = 'https://' .$sites[$sitesID]['base_url']. '/' . $_url; |                                 $_url = 'https://' .$sites[$sitesID]['base_url']. '/' . $_url; | ||||||
| 								print "种子下载页:".$_url. "\n"; |                                 print "种子下载页:".$_url. "\n"; | ||||||
| 								$url = download($_url, $cookie, $userAgent); |                                 $url = download($_url, $cookie, $userAgent); | ||||||
| 								if(strpos($url,'系统检测到过多的种子下载请求') != false){ |                                 if (strpos($url, '系统检测到过多的种子下载请求') != false) { | ||||||
| 									echo "当前站点触发人机验证,已加入排除列表 \n"; |                                     echo "当前站点触发人机验证,已加入排除列表 \n"; | ||||||
| 									ff($sites[$sitesID]['site']. '站点,辅种时触发人机验证!'); |                                     ff($sites[$sitesID]['site']. '站点,辅种时触发人机验证!'); | ||||||
| 									$configALL[$sites[$sitesID]['site']]['limit'] = 1; |                                     $configALL[$sites[$sitesID]['site']]['limit'] = 1; | ||||||
| 									self::$noReseed[] = 'hdchina'; |                                     self::$noReseed[] = 'hdchina'; | ||||||
| 								} |                                 } | ||||||
| 								break; |                                 break; | ||||||
| 							case 'hdcity': |                             case 'hdcity': | ||||||
| 								$cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : ''; |                                 $cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : ''; | ||||||
| 								$userAgent = $configALL['default']['userAgent']; |                                 $userAgent = $configALL['default']['userAgent']; | ||||||
| 								print "种子:".$_url. "\n"; |                                 print "种子:".$_url. "\n"; | ||||||
| 								if ( isset($configALL[$sites[$sitesID]['site']]['cuhash']) ) { |                                 if (isset($configALL[$sites[$sitesID]['site']]['cuhash'])) { | ||||||
| 									// 已获取cuhash |                                     // 已获取cuhash | ||||||
| 									# code... |                                     # code... | ||||||
| 								}else { |                                 } else { | ||||||
| 									// 获取cuhash |                                     // 获取cuhash | ||||||
| 									$html = download('https://' .$sites[$sitesID]['base_url']. '/pt', $cookie, $userAgent); |                                     $html = download('https://' .$sites[$sitesID]['base_url']. '/pt', $cookie, $userAgent); | ||||||
| 									// 提取种子下载地址 |                                     // 提取种子下载地址 | ||||||
| 									$offset = strpos($html,'cuhash='); |                                     $offset = strpos($html, 'cuhash='); | ||||||
| 									$len = strlen('cuhash='); |                                     $len = strlen('cuhash='); | ||||||
| 									$cuhashTemp = substr($html,$offset+$len,40); |                                     $cuhashTemp = substr($html, $offset+$len, 40); | ||||||
| 									$configALL[$sites[$sitesID]['site']]['cuhash'] = substr($cuhashTemp,0,strpos($cuhashTemp,'"')); |                                     $configALL[$sites[$sitesID]['site']]['cuhash'] = substr($cuhashTemp, 0, strpos($cuhashTemp, '"')); | ||||||
| 								} |                                 } | ||||||
| 								$url = $_url."&cuhash=". $configALL[$sites[$sitesID]['site']]['cuhash']; |                                 $url = $_url."&cuhash=". $configALL[$sites[$sitesID]['site']]['cuhash']; | ||||||
| 								// 城市下载种子时会302转向 |                                 // 城市下载种子时会302转向 | ||||||
| 								$url = download($url, $cookie, $userAgent); |                                 $url = download($url, $cookie, $userAgent); | ||||||
| 								break; |                                 break; | ||||||
| 							default: |                             default: | ||||||
| 								// 默认站点:推送给下载器种子URL链接 |                                 // 默认站点:推送给下载器种子URL链接 | ||||||
| 								break; |                                 break; | ||||||
| 						} |                         } | ||||||
| 						// 把拼接的种子URL,推送给下载器 |                         // 把拼接的种子URL,推送给下载器 | ||||||
| 						$ret = false; |                         $ret = false; | ||||||
| 						// 成功返回:true |                         // 成功返回:true | ||||||
| 						$ret = self::add($k, $url, $downloadDir); |                         $ret = self::add($k, $url, $downloadDir); | ||||||
| 						// 添加成功的种子,以infohash为文件名,写入缓存 |                         // 添加成功的种子,以infohash为文件名,写入缓存 | ||||||
| 						if ($ret) { |                         if ($ret) { | ||||||
|                             // 成功的种子 |                             // 成功的种子 | ||||||
|                             switch ($sites[$sitesID]['site']) { |                             switch ($sites[$sitesID]['site']) { | ||||||
| 								case 'hdchina': |                                 case 'hdchina': | ||||||
| 									$url = $details_url; |                                     $url = $details_url; | ||||||
|                                     break; |                                     break; | ||||||
|                                 case 'hdcity': |                                 case 'hdcity': | ||||||
|                                     $url = $_url; |                                     $url = $_url; | ||||||
|                                     break; |                                     break; | ||||||
| 								default: |                                 default: | ||||||
| 									break; |                                     break; | ||||||
| 							} |                             } | ||||||
| 							// 文件句柄 |                             // 文件句柄 | ||||||
| 							$resource = fopen(self::$cacheHash . $value['info_hash'].'.txt', "wb"); |                             $resource = fopen(self::$cacheHash . $value['info_hash'].'.txt', "wb"); | ||||||
| 							// 成功:返回写入字节数,失败返回false |                             // 成功:返回写入字节数,失败返回false | ||||||
| 							$worldsnum = fwrite($resource, $url); |                             $worldsnum = fwrite($resource, $url); | ||||||
| 							fclose($resource); |                             fclose($resource); | ||||||
| 							self::$wechatMsg['reseedSuccess']++; |                             self::$wechatMsg['reseedSuccess']++; | ||||||
| 							continue; |                             continue; | ||||||
| 						}else{ |                         } else { | ||||||
| 							// 失败的种子 |                             // 失败的种子 | ||||||
| 							// 不同站点的错误提示 |                             // 不同站点的错误提示 | ||||||
| 							switch ($sites[$sitesID]['site']) { |                             switch ($sites[$sitesID]['site']) { | ||||||
| 								case 'hdcity': |                                 case 'hdcity': | ||||||
| 									break; |                                     break; | ||||||
| 								default: |                                 default: | ||||||
| 									break; |                                     break; | ||||||
| 							} |                             } | ||||||
| 							// 失败累加 |                             // 失败累加 | ||||||
| 							self::$wechatMsg['reseedError']++; |                             self::$wechatMsg['reseedError']++; | ||||||
| 							continue; |                             continue; | ||||||
| 						} |                         } | ||||||
| 					}else{ |                     } else { | ||||||
| 						/** |                         /** | ||||||
| 						 *  不辅种 |                          *  不辅种 | ||||||
| 						 */ |                          */ | ||||||
| 						echo '-------已跳过不辅种的站点:'.$_url."\n\n"; |                         echo '-------已跳过不辅种的站点:'.$_url."\n\n"; | ||||||
| 						// 写入日志文件,供用户手动辅种 |                         // 写入日志文件,供用户手动辅种 | ||||||
| 						if ( !isset($infohash_Dir[$value['info_hash']]) ) { |                         if (!isset($infohash_Dir[$value['info_hash']])) { | ||||||
| 							// 站点类型判断 |                             // 站点类型判断 | ||||||
| 							switch ($sites[$sitesID]['site']) { |                             switch ($sites[$sitesID]['site']) { | ||||||
| 								case 'hdchina': |                                 case 'hdchina': | ||||||
| 									$url = $_url; |                                     $url = $_url; | ||||||
| 									break; |                                     break; | ||||||
| 								default: |                                 default: | ||||||
| 									break; |                                     break; | ||||||
| 							} |                             } | ||||||
| 							// 文件句柄 |                             // 文件句柄 | ||||||
| 							$resource = fopen(self::$cacheDir . $sites[$sitesID]['site'].'.txt', 'a'); |                             $resource = fopen(self::$cacheDir . $sites[$sitesID]['site'].'.txt', 'a'); | ||||||
| 							// 成功:返回写入字节数,失败返回false |                             // 成功:返回写入字节数,失败返回false | ||||||
| 							$worldsnum = fwrite($resource, 'clients_'.$k."\n".$downloadDir."\n".$url."\n".$details_url."\n\n"); |                             $worldsnum = fwrite($resource, 'clients_'.$k."\n".$downloadDir."\n".$url."\n".$details_url."\n\n"); | ||||||
| 							fclose($resource); |                             fclose($resource); | ||||||
| 						} |                         } | ||||||
| 					} |                     } | ||||||
| 				} |                 } | ||||||
| 			} |             } | ||||||
| 		} |         } | ||||||
| 		// 按客户端循环辅种 结束 |         // 按客户端循环辅种 结束 | ||||||
| 	} |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * |      * | ||||||
|   | |||||||
| @@ -17,5 +17,4 @@ interface AbstractClientInterface | |||||||
|      * @return string |      * @return string | ||||||
|      */ |      */ | ||||||
|     public function status(); |     public function status(); | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user