@@ -54,11 +54,12 @@ discard block |
||
54 | 54 | $postMultipart = false; |
55 | 55 | foreach ($postFields as $k => $v) |
56 | 56 | { |
57 | - if("@" != substr($v, 0, 1))//判断是不是文件上传 |
|
57 | + if("@" != substr($v, 0, 1)) { |
|
58 | + //判断是不是文件上传 |
|
58 | 59 | { |
59 | - $postBodyString .= "$k=" . urlencode($v) . "&"; |
|
60 | + $postBodyString .= "$k=" . urlencode($v) . "&"; |
|
60 | 61 | } |
61 | - else//文件上传用multipart/form-data,否则用www-form-urlencoded |
|
62 | + } else//文件上传用multipart/form-data,否则用www-form-urlencoded |
|
62 | 63 | { |
63 | 64 | $postMultipart = true; |
64 | 65 | if(class_exists('\CURLFile')){ |
@@ -78,8 +79,7 @@ discard block |
||
78 | 79 | } |
79 | 80 | } |
80 | 81 | curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); |
81 | - } |
|
82 | - else |
|
82 | + } else |
|
83 | 83 | { |
84 | 84 | $header = array("content-type: application/x-www-form-urlencoded; charset=UTF-8"); |
85 | 85 | curl_setopt($ch,CURLOPT_HTTPHEADER,$header); |
@@ -91,8 +91,7 @@ discard block |
||
91 | 91 | if (curl_errno($ch)) |
92 | 92 | { |
93 | 93 | throw new Exception(curl_error($ch),0); |
94 | - } |
|
95 | - else |
|
94 | + } else |
|
96 | 95 | { |
97 | 96 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
98 | 97 | if (200 !== $httpStatusCode) |
@@ -144,8 +143,7 @@ discard block |
||
144 | 143 | if (curl_errno($ch)) |
145 | 144 | { |
146 | 145 | throw new Exception(curl_error($ch),0); |
147 | - } |
|
148 | - else |
|
146 | + } else |
|
149 | 147 | { |
150 | 148 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
151 | 149 | if (200 !== $httpStatusCode) |
@@ -185,11 +183,12 @@ discard block |
||
185 | 183 | if(!is_string($v)){ |
186 | 184 | $v = json_encode($v); |
187 | 185 | } |
188 | - if("@" != substr($v, 0, 1))//判断是不是文件上传 |
|
186 | + if("@" != substr($v, 0, 1)) { |
|
187 | + //判断是不是文件上传 |
|
189 | 188 | { |
190 | 189 | $postBodyString .= "$k=" . urlencode($v) . "&"; |
191 | 190 | } |
192 | - else//文件上传用multipart/form-data,否则用www-form-urlencoded |
|
191 | + } else//文件上传用multipart/form-data,否则用www-form-urlencoded |
|
193 | 192 | { |
194 | 193 | $postMultipart = true; |
195 | 194 | if(class_exists('\CURLFile')){ |
@@ -209,8 +208,7 @@ discard block |
||
209 | 208 | } |
210 | 209 | } |
211 | 210 | curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); |
212 | - } |
|
213 | - else { |
|
211 | + } else { |
|
214 | 212 | $header = array("Content-Type: application/json; charset=utf-8", "Content-Length:".strlen(json_encode($postFields))); |
215 | 213 | curl_setopt($ch,CURLOPT_HTTPHEADER,$header); |
216 | 214 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postFields)); |
@@ -221,8 +219,7 @@ discard block |
||
221 | 219 | if (curl_errno($ch)) |
222 | 220 | { |
223 | 221 | throw new Exception(curl_error($ch),0); |
224 | - } |
|
225 | - else |
|
222 | + } else |
|
226 | 223 | { |
227 | 224 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
228 | 225 | if (200 !== $httpStatusCode) |
@@ -294,8 +291,7 @@ discard block |
||
294 | 291 | if (curl_errno($ch)) |
295 | 292 | { |
296 | 293 | throw new Exception(curl_error($ch),0); |
297 | - } |
|
298 | - else |
|
294 | + } else |
|
299 | 295 | { |
300 | 296 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
301 | 297 | if (200 !== $httpStatusCode) |
@@ -329,7 +325,7 @@ discard block |
||
329 | 325 | public function execute($request, $session = null,$bestUrl = null){ |
330 | 326 | if(DingTalkConstant::$CALL_TYPE_OAPI == $this->apiCallType){ |
331 | 327 | return $this->_executeOapi($request, $session, $bestUrl, null, null, null, null); |
332 | - }else{ |
|
328 | + } else{ |
|
333 | 329 | return $this->_execute($request, $session, $bestUrl); |
334 | 330 | } |
335 | 331 | } |
@@ -345,7 +341,7 @@ discard block |
||
345 | 341 | public function executeWithCorpId($request, $bestUrl = null, $accessKey, $accessSecret, $suiteTicket, $corpId) { |
346 | 342 | if(DingTalkConstant::$CALL_TYPE_OAPI == $this->apiCallType){ |
347 | 343 | return $this->_executeOapi($request, null, $bestUrl,$accessKey, $accessSecret, $suiteTicket, $corpId); |
348 | - }else{ |
|
344 | + } else{ |
|
349 | 345 | return $this->_execute($request, null, $bestUrl); |
350 | 346 | } |
351 | 347 | } |
@@ -368,10 +364,10 @@ discard block |
||
368 | 364 | if($bestUrl){ |
369 | 365 | if(strpos($bestUrl,'?') === false){ |
370 | 366 | $requestUrl = $bestUrl."?"; |
371 | - }else{ |
|
367 | + } else{ |
|
372 | 368 | $requestUrl = $bestUrl; |
373 | 369 | } |
374 | - }else{ |
|
370 | + } else{ |
|
375 | 371 | $requestUrl = $this->gatewayUrl."?"; |
376 | 372 | } |
377 | 373 | if(null != $accessKey){ |
@@ -392,7 +388,7 @@ discard block |
||
392 | 388 | foreach ($queryParams as $queryParamKey => $queryParamValue) { |
393 | 389 | $requestUrl .= "$queryParamKey=" . urlencode($queryParamValue) . "&"; |
394 | 390 | } |
395 | - }else{ |
|
391 | + } else{ |
|
396 | 392 | $requestUrl .= "access_token=" . urlencode($session) . "&"; |
397 | 393 | } |
398 | 394 | |
@@ -416,15 +412,14 @@ discard block |
||
416 | 412 | { |
417 | 413 | if(count($fileFields) > 0){ |
418 | 414 | $resp = $this->curl_with_memory_file($requestUrl, $apiParams, $fileFields); |
419 | - }else{ |
|
415 | + } else{ |
|
420 | 416 | if(DingTalkConstant::$METHOD_POST == $this->httpMethod){ |
421 | 417 | $resp = $this->curl_json($requestUrl, $apiParams); |
422 | - }else{ |
|
418 | + } else{ |
|
423 | 419 | $resp = $this->curl_get($requestUrl, $apiParams); |
424 | 420 | } |
425 | 421 | } |
426 | - } |
|
427 | - catch (Exception $e) |
|
422 | + } catch (Exception $e) |
|
428 | 423 | { |
429 | 424 | $this->logCommunicationError($sysParams["method"],$requestUrl,"HTTP_ERROR_" . $e->getCode(),$e->getMessage()); |
430 | 425 | $result->code = $e->getCode(); |
@@ -443,8 +438,7 @@ discard block |
||
443 | 438 | { |
444 | 439 | $respWellFormed = true; |
445 | 440 | } |
446 | - } |
|
447 | - else if("xml" == $this->format) |
|
441 | + } else if("xml" == $this->format) |
|
448 | 442 | { |
449 | 443 | $respObject = @simplexml_load_string($resp); |
450 | 444 | if (false !== $respObject) |
@@ -524,11 +518,11 @@ discard block |
||
524 | 518 | if($bestUrl){ |
525 | 519 | if(strpos($bestUrl,'?') === false){ |
526 | 520 | $requestUrl = $bestUrl."?"; |
527 | - }else{ |
|
521 | + } else{ |
|
528 | 522 | $requestUrl = $bestUrl; |
529 | 523 | } |
530 | 524 | $sysParams["partner_id"] = $this->getClusterTag(); |
531 | - }else{ |
|
525 | + } else{ |
|
532 | 526 | $requestUrl = $this->gatewayUrl."?"; |
533 | 527 | $sysParams["partner_id"] = $this->sdkVersion; |
534 | 528 | } |
@@ -556,11 +550,10 @@ discard block |
||
556 | 550 | { |
557 | 551 | if(count($fileFields) > 0){ |
558 | 552 | $resp = $this->curl_with_memory_file($requestUrl, $apiParams, $fileFields); |
559 | - }else{ |
|
553 | + } else{ |
|
560 | 554 | $resp = $this->curl($requestUrl, $apiParams); |
561 | 555 | } |
562 | - } |
|
563 | - catch (Exception $e) |
|
556 | + } catch (Exception $e) |
|
564 | 557 | { |
565 | 558 | $this->logCommunicationError($sysParams["method"],$requestUrl,"HTTP_ERROR_" . $e->getCode(),$e->getMessage()); |
566 | 559 | $result->code = $e->getCode(); |
@@ -583,8 +576,7 @@ discard block |
||
583 | 576 | $respObject = $propValue; |
584 | 577 | } |
585 | 578 | } |
586 | - } |
|
587 | - else if("xml" == $this->format) |
|
579 | + } else if("xml" == $this->format) |
|
588 | 580 | { |
589 | 581 | $respObject = @simplexml_load_string($resp); |
590 | 582 | if (false !== $respObject) |
@@ -77,11 +77,12 @@ discard block |
||
77 | 77 | $postMultipart = false; |
78 | 78 | foreach ($postFields as $k => $v) |
79 | 79 | { |
80 | - if("@" != substr($v, 0, 1))//判断是不是文件上传 |
|
80 | + if("@" != substr($v, 0, 1)) { |
|
81 | + //判断是不是文件上传 |
|
81 | 82 | { |
82 | - $postBodyString .= "$k=" . urlencode($v) . "&"; |
|
83 | + $postBodyString .= "$k=" . urlencode($v) . "&"; |
|
83 | 84 | } |
84 | - else//文件上传用multipart/form-data,否则用www-form-urlencoded |
|
85 | + } else//文件上传用multipart/form-data,否则用www-form-urlencoded |
|
85 | 86 | { |
86 | 87 | $postMultipart = true; |
87 | 88 | if(class_exists('\CURLFile')){ |
@@ -101,8 +102,7 @@ discard block |
||
101 | 102 | } |
102 | 103 | } |
103 | 104 | curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); |
104 | - } |
|
105 | - else |
|
105 | + } else |
|
106 | 106 | { |
107 | 107 | $header = array("content-type: application/x-www-form-urlencoded; charset=UTF-8"); |
108 | 108 | curl_setopt($ch,CURLOPT_HTTPHEADER,$header); |
@@ -114,8 +114,7 @@ discard block |
||
114 | 114 | if (curl_errno($ch)) |
115 | 115 | { |
116 | 116 | throw new Exception(curl_error($ch),0); |
117 | - } |
|
118 | - else |
|
117 | + } else |
|
119 | 118 | { |
120 | 119 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
121 | 120 | if (200 !== $httpStatusCode) |
@@ -186,8 +185,7 @@ discard block |
||
186 | 185 | if (curl_errno($ch)) |
187 | 186 | { |
188 | 187 | throw new Exception(curl_error($ch),0); |
189 | - } |
|
190 | - else |
|
188 | + } else |
|
191 | 189 | { |
192 | 190 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
193 | 191 | if (200 !== $httpStatusCode) |
@@ -257,7 +255,7 @@ discard block |
||
257 | 255 | if($bestUrl){ |
258 | 256 | $requestUrl = $bestUrl."?"; |
259 | 257 | $sysParams["partner_id"] = $this->getClusterTag(); |
260 | - }else{ |
|
258 | + } else{ |
|
261 | 259 | $requestUrl = $this->gatewayUrl."?"; |
262 | 260 | $sysParams["partner_id"] = $this->sdkVersion; |
263 | 261 | } |
@@ -287,11 +285,10 @@ discard block |
||
287 | 285 | { |
288 | 286 | if(count($fileFields) > 0){ |
289 | 287 | $resp = $this->curl_with_memory_file($requestUrl, $apiParams, $fileFields); |
290 | - }else{ |
|
288 | + } else{ |
|
291 | 289 | $resp = $this->curl($requestUrl, $apiParams); |
292 | 290 | } |
293 | - } |
|
294 | - catch (Exception $e) |
|
291 | + } catch (Exception $e) |
|
295 | 292 | { |
296 | 293 | $this->logCommunicationError($sysParams["method"],$requestUrl,"HTTP_ERROR_" . $e->getCode(),$e->getMessage()); |
297 | 294 | $result->code = $e->getCode(); |
@@ -314,8 +311,7 @@ discard block |
||
314 | 311 | $respObject = $propValue; |
315 | 312 | } |
316 | 313 | } |
317 | - } |
|
318 | - else if("xml" == $this->format) |
|
314 | + } else if("xml" == $this->format) |
|
319 | 315 | { |
320 | 316 | $respObject = @simplexml_load_string($resp); |
321 | 317 | if (false !== $respObject) |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $clientTimestamp = strtotime($ts); |
166 | 166 | $current = $_SERVER['REQUEST_TIME']; |
167 | 167 | return ($current - $clientTimestamp) <= 5*60*1000; |
168 | - }else{ |
|
168 | + } else{ |
|
169 | 169 | return false; |
170 | 170 | } |
171 | 171 | } |
@@ -190,8 +190,9 @@ discard block |
||
190 | 190 | $stringToBeSigned = $secret; |
191 | 191 | $stringToBeSigned .= self::getParamStrFromMap($params); |
192 | 192 | |
193 | - if($body) |
|
194 | - $stringToBeSigned .= $body; |
|
193 | + if($body) { |
|
194 | + $stringToBeSigned .= $body; |
|
195 | + } |
|
195 | 196 | $stringToBeSigned .= $secret; |
196 | 197 | return strtoupper(md5($stringToBeSigned)); |
197 | 198 | } |
@@ -75,11 +75,12 @@ discard block |
||
75 | 75 | $postMultipart = false; |
76 | 76 | foreach ($postFields as $k => $v) |
77 | 77 | { |
78 | - if("@" != substr($v, 0, 1))//判断是不是文件上传 |
|
78 | + if("@" != substr($v, 0, 1)) { |
|
79 | + //判断是不是文件上传 |
|
79 | 80 | { |
80 | - $postBodyString .= "$k=" . urlencode($v) . "&"; |
|
81 | + $postBodyString .= "$k=" . urlencode($v) . "&"; |
|
81 | 82 | } |
82 | - else//文件上传用multipart/form-data,否则用www-form-urlencoded |
|
83 | + } else//文件上传用multipart/form-data,否则用www-form-urlencoded |
|
83 | 84 | { |
84 | 85 | $postMultipart = true; |
85 | 86 | if(class_exists('\CURLFile')){ |
@@ -99,8 +100,7 @@ discard block |
||
99 | 100 | } |
100 | 101 | } |
101 | 102 | curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); |
102 | - } |
|
103 | - else |
|
103 | + } else |
|
104 | 104 | { |
105 | 105 | $header = array("content-type: application/x-www-form-urlencoded; charset=UTF-8"); |
106 | 106 | curl_setopt($ch,CURLOPT_HTTPHEADER,$header); |
@@ -112,8 +112,7 @@ discard block |
||
112 | 112 | if (curl_errno($ch)) |
113 | 113 | { |
114 | 114 | throw new Exception(curl_error($ch),0); |
115 | - } |
|
116 | - else |
|
115 | + } else |
|
117 | 116 | { |
118 | 117 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
119 | 118 | if (200 !== $httpStatusCode) |
@@ -184,8 +183,7 @@ discard block |
||
184 | 183 | if (curl_errno($ch)) |
185 | 184 | { |
186 | 185 | throw new Exception(curl_error($ch),0); |
187 | - } |
|
188 | - else |
|
186 | + } else |
|
189 | 187 | { |
190 | 188 | $httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
191 | 189 | if (200 !== $httpStatusCode) |
@@ -250,7 +248,7 @@ discard block |
||
250 | 248 | if($bestUrl){ |
251 | 249 | $requestUrl = $bestUrl."?"; |
252 | 250 | $sysParams["partner_id"] = $this->getClusterTag(); |
253 | - }else{ |
|
251 | + } else{ |
|
254 | 252 | $requestUrl = $this->gatewayUrl."?"; |
255 | 253 | $sysParams["partner_id"] = $this->sdkVersion; |
256 | 254 | } |
@@ -280,11 +278,10 @@ discard block |
||
280 | 278 | { |
281 | 279 | if(count($fileFields) > 0){ |
282 | 280 | $resp = $this->curl_with_memory_file($requestUrl, $apiParams, $fileFields); |
283 | - }else{ |
|
281 | + } else{ |
|
284 | 282 | $resp = $this->curl($requestUrl, $apiParams); |
285 | 283 | } |
286 | - } |
|
287 | - catch (Exception $e) |
|
284 | + } catch (Exception $e) |
|
288 | 285 | { |
289 | 286 | $this->logCommunicationError($sysParams["method"],$requestUrl,"HTTP_ERROR_" . $e->getCode(),$e->getMessage()); |
290 | 287 | $result->code = $e->getCode(); |
@@ -307,8 +304,7 @@ discard block |
||
307 | 304 | $respObject = $propValue; |
308 | 305 | } |
309 | 306 | } |
310 | - } |
|
311 | - else if("xml" == $this->format) |
|
307 | + } else if("xml" == $this->format) |
|
312 | 308 | { |
313 | 309 | $respObject = @simplexml_load_string($resp); |
314 | 310 | if (false !== $respObject) |
@@ -8,8 +8,9 @@ discard block |
||
8 | 8 | |
9 | 9 | function __construct() |
10 | 10 | { |
11 | - if (!extension_loaded("yac")) |
|
12 | - $this->isEnable = false; |
|
11 | + if (!extension_loaded("yac")) { |
|
12 | + $this->isEnable = false; |
|
13 | + } |
|
13 | 14 | } |
14 | 15 | |
15 | 16 | public function getCache($key) |
@@ -18,7 +19,7 @@ discard block |
||
18 | 19 | if($this->isEnable){ |
19 | 20 | $yac = new Yac(); |
20 | 21 | return $yac->get($key); |
21 | - }else{ |
|
22 | + } else{ |
|
22 | 23 | echo "yac is not enable ,skip getCache"; |
23 | 24 | } |
24 | 25 | } |
@@ -29,7 +30,7 @@ discard block |
||
29 | 30 | if($this->isEnable){ |
30 | 31 | $yac = new Yac(); |
31 | 32 | $yac->set($key, $var); |
32 | - }else{ |
|
33 | + } else{ |
|
33 | 34 | echo "yac is not enable ,skip setCache"; |
34 | 35 | } |
35 | 36 | } |
@@ -69,8 +69,7 @@ discard block |
||
69 | 69 | if($str[$i] == $sep) |
70 | 70 | { |
71 | 71 | $start = $i + 1; |
72 | - } |
|
73 | - else |
|
72 | + } else |
|
74 | 73 | { |
75 | 74 | break; |
76 | 75 | } |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | if($str[$i] == $sep) |
81 | 80 | { |
82 | 81 | $end = $i - 1; |
83 | - } |
|
84 | - else |
|
82 | + } else |
|
85 | 83 | { |
86 | 84 | break; |
87 | 85 | } |
@@ -93,7 +91,7 @@ discard block |
||
93 | 91 | { |
94 | 92 | if(count($dataArray) == 2){ |
95 | 93 | return $this->isBase64Str($dataArray[0]); |
96 | - }else{ |
|
94 | + } else{ |
|
97 | 95 | return $this->isBase64Str($dataArray[0]) && $this->isBase64Str($dataArray[1]); |
98 | 96 | } |
99 | 97 | } |
@@ -155,8 +153,7 @@ discard block |
||
155 | 153 | if($data[$strlen - 2] == $separator) |
156 | 154 | { |
157 | 155 | return $this->checkEncryptData($dataArray); |
158 | - } |
|
159 | - else |
|
156 | + } else |
|
160 | 157 | { |
161 | 158 | $version = $dataArray[$arrayLength -1]; |
162 | 159 | if(is_numeric($version)) |
@@ -165,16 +162,14 @@ discard block |
||
165 | 162 | return $this->isBase64Str($base64Val); |
166 | 163 | } |
167 | 164 | } |
168 | - }else{ |
|
165 | + } else{ |
|
169 | 166 | if($data[strlen($data) - 2] == $separator && $arrayLength == 3) |
170 | 167 | { |
171 | 168 | return $this->checkEncryptData($dataArray); |
172 | - } |
|
173 | - else if($arrayLength == 2) |
|
169 | + } else if($arrayLength == 2) |
|
174 | 170 | { |
175 | 171 | return $this->checkEncryptData($dataArray); |
176 | - } |
|
177 | - else |
|
172 | + } else |
|
178 | 173 | { |
179 | 174 | return false; |
180 | 175 | } |
@@ -222,7 +217,7 @@ discard block |
||
222 | 217 | $slideSize = $this->getArrayValue($secretContext->appConfig,'encrypt_slide_size',4); |
223 | 218 | return $this->encryptNormalIndex($data,$compressLen,$slideSize,$separator,$secretContext); |
224 | 219 | } |
225 | - }else{ |
|
220 | + } else{ |
|
226 | 221 | if('phone' == $type) { |
227 | 222 | return $this->encryptPhone($data,$separator,$secretContext); |
228 | 223 | } else { |
@@ -273,7 +268,7 @@ discard block |
||
273 | 268 | $secretData = null; |
274 | 269 | if($data[$dataLen - 2] == $separator){ |
275 | 270 | $secretData = $this->getIndexSecretData($data,$separator); |
276 | - }else{ |
|
271 | + } else{ |
|
277 | 272 | $secretData = $this->getSecretData($data,$separator); |
278 | 273 | } |
279 | 274 | |
@@ -312,7 +307,7 @@ discard block |
||
312 | 307 | |
313 | 308 | if($data[$dataLen - 2] == $separator){ |
314 | 309 | return $secretData = $this->getIndexSecretData($data,$separator); |
315 | - }else{ |
|
310 | + } else{ |
|
316 | 311 | return $secretData = $this->getSecretData($data,$separator); |
317 | 312 | } |
318 | 313 | } |
@@ -330,7 +325,7 @@ discard block |
||
330 | 325 | { |
331 | 326 | if($arrayLength != 3){ |
332 | 327 | return null; |
333 | - }else{ |
|
328 | + } else{ |
|
334 | 329 | $version = $dataArray[2]; |
335 | 330 | if(is_numeric($version)) |
336 | 331 | { |
@@ -339,12 +334,11 @@ discard block |
||
339 | 334 | $secretData->secretVersion = $version; |
340 | 335 | } |
341 | 336 | } |
342 | - } |
|
343 | - else |
|
337 | + } else |
|
344 | 338 | { |
345 | 339 | if($arrayLength != 2){ |
346 | 340 | return null; |
347 | - }else{ |
|
341 | + } else{ |
|
348 | 342 | $version = $dataArray[1]; |
349 | 343 | if(is_numeric($version)) |
350 | 344 | { |
@@ -364,7 +358,7 @@ discard block |
||
364 | 358 | if($separator == PHONE_SEPARATOR_CHAR) { |
365 | 359 | if ($arrayLength != 3) { |
366 | 360 | return null; |
367 | - }else{ |
|
361 | + } else{ |
|
368 | 362 | $version = $dataArray[2]; |
369 | 363 | if(is_numeric($version)) |
370 | 364 | { |
@@ -517,7 +511,7 @@ discard block |
||
517 | 511 | if($endIndex != 0){ |
518 | 512 | if($startsWithLetterOrDigit){ |
519 | 513 | $currentWindowSize -= 1; |
520 | - }else{ |
|
514 | + } else{ |
|
521 | 515 | $currentWindowSize -= 2; |
522 | 516 | } |
523 | 517 | $startIndex ++; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | if(empty($secretData)){ |
137 | 137 | $result[$value] = $value; |
138 | - }else{ |
|
138 | + } else{ |
|
139 | 139 | $result[$value] = $this->securityUtil->decrypt($value,$type,$secretContext); |
140 | 140 | $this->incrCounter(2,$type,$secretContext,true); |
141 | 141 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | default: |
392 | 392 | break; |
393 | 393 | } |
394 | - }else if($op == 2){ |
|
394 | + } else if($op == 2){ |
|
395 | 395 | switch ($type) { |
396 | 396 | case 'nick': |
397 | 397 | $secretContext->decryptNickNum ++ ; |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | default: |
409 | 409 | break; |
410 | 410 | } |
411 | - }else{ |
|
411 | + } else{ |
|
412 | 412 | switch ($type) { |
413 | 413 | case 'nick': |
414 | 414 | $secretContext->searchNickNum ++ ; |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | |
479 | 479 | if(empty($secretContext->session)){ |
480 | 480 | $request->setType(APP_SECRET_TYPE); |
481 | - }else{ |
|
481 | + } else{ |
|
482 | 482 | $request->setType(APP_USER_SECRET_TYPE); |
483 | 483 | } |
484 | 484 | |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | |
535 | 535 | if(empty($session)){ |
536 | 536 | $secretContext->secretVersion = -1 * intval($response->secret_version); |
537 | - }else{ |
|
537 | + } else{ |
|
538 | 538 | $secretContext->secretVersion = intval($response->secret_version); |
539 | 539 | } |
540 | 540 | return $secretContext; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $originalValue = $client->decrypt($encty2,$type2,$session); |
51 | 51 | echo "解密后:".$originalValue.PHP_EOL; |
52 | 52 | echo "search明文:".$originalValue." -->".$client->search($originalValue,$type2,$session).PHP_EOL; |
53 | - }else{ |
|
53 | + } else{ |
|
54 | 54 | echo "不是加密数据".PHP_EOL; |
55 | 55 | } |
56 | 56 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $originalNick = $client->decryptPublic($encryptNick,"nick"); |
64 | 64 | echo "解密后:".$originalNick.PHP_EOL; |
65 | - }else{ |
|
65 | + } else{ |
|
66 | 66 | echo "不是加密数据 ".$encryptNick.PHP_EOL; |
67 | 67 | } |
68 | 68 | ?> |
69 | 69 | \ No newline at end of file |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | |
49 | 49 | if($type == "nick"){ |
50 | 50 | $item->$decryptNickNum += $delt; |
51 | - }else if($type == "receiver_name"){ |
|
51 | + } else if($type == "receiver_name"){ |
|
52 | 52 | $item->$decryptReceiverNameNum += $delt ; |
53 | - }else if($type == "phone"){ |
|
53 | + } else if($type == "phone"){ |
|
54 | 54 | $item->$decryptPhoneNum += $delt ; |
55 | - }else if($type == "simple"){ |
|
55 | + } else if($type == "simple"){ |
|
56 | 56 | $item->$decryptSimpleNum += $delt ; |
57 | 57 | } |
58 | 58 | } |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | |
68 | 68 | if($type == "nick"){ |
69 | 69 | $item->$encryptNickNum += $delt ; |
70 | - }else if($type == "receiver_name"){ |
|
70 | + } else if($type == "receiver_name"){ |
|
71 | 71 | $item->$encryptReceiverNameNum += $delt ; |
72 | - }else if($type == "phone"){ |
|
72 | + } else if($type == "phone"){ |
|
73 | 73 | $item->$encryptPhoneNum += $delt ; |
74 | - }else if($type == "simple"){ |
|
74 | + } else if($type == "simple"){ |
|
75 | 75 | $item->$encryptSimpleNum += $delt ; |
76 | 76 | } |
77 | 77 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | if($this->cacheClient == null){ |
82 | 82 | return $counterMap[$session]; |
83 | - }else{ |
|
83 | + } else{ |
|
84 | 84 | return $this->cacheClient->getCache('s_'.$session); |
85 | 85 | } |
86 | 86 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | if($this->cacheClient == null){ |
91 | 91 | $counterMap[$session] = $item; |
92 | - }else{ |
|
92 | + } else{ |
|
93 | 93 | $this->cacheClient->setCache('s_'.$session,$item); |
94 | 94 | } |
95 | 95 | } |