@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | private function http() |
131 | 131 | { |
132 | 132 | $ch = curl_init(); |
133 | - curl_setopt($ch, CURLOPT_URL, $this->panel . $this->url); |
|
133 | + curl_setopt($ch, CURLOPT_URL, $this->panel.$this->url); |
|
134 | 134 | curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); |
135 | 135 | curl_setopt($ch, CURLOPT_POST, 1); |
136 | 136 | curl_setopt($ch, CURLOPT_POSTFIELDS, array_merge($this->getKeyData(), $this->data)); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | { |
155 | 155 | $time = time(); |
156 | 156 | return array( |
157 | - 'request_token' => md5($time . '' . md5($this->key)), |
|
157 | + 'request_token' => md5($time.''.md5($this->key)), |
|
158 | 158 | 'request_time' => $time |
159 | 159 | ); |
160 | 160 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | if (is_array($str)) { |
56 | 56 | $this->data = json_encode($str, JSON_UNESCAPED_UNICODE); |
57 | - } else { |
|
57 | + }else { |
|
58 | 58 | $this->data = $str; |
59 | 59 | } |
60 | 60 | return $this; |
@@ -150,13 +150,13 @@ discard block |
||
150 | 150 | } |
151 | 151 | if ($this->method === 'GET') { |
152 | 152 | $this->httpGet(); |
153 | - } else if ($this->method === 'POST') { |
|
153 | + }else if ($this->method === 'POST') { |
|
154 | 154 | $this->httpPost(); |
155 | - } else if ($this->method === 'XML') { |
|
155 | + }else if ($this->method === 'XML') { |
|
156 | 156 | $this->httpXml(); |
157 | - } else if ($this->method === 'FILE') { |
|
157 | + }else if ($this->method === 'FILE') { |
|
158 | 158 | $this->httpFile(); |
159 | - } else { |
|
159 | + }else { |
|
160 | 160 | throw new HttpException(404, '请求方式异常'); |
161 | 161 | } |
162 | 162 | if (empty($is)) { |
@@ -198,12 +198,12 @@ discard block |
||
198 | 198 | { |
199 | 199 | $ch = curl_init(); |
200 | 200 | curl_setopt($ch, CURLOPT_URL, $this->url); |
201 | - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: ' . $this->headers)); |
|
201 | + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: '.$this->headers)); |
|
202 | 202 | curl_setopt($ch, CURLOPT_HEADER, 0); |
203 | 203 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
204 | 204 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
205 | 205 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查 |
206 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在 |
|
206 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在 |
|
207 | 207 | curl_setopt($ch, CURLOPT_POST, 1); |
208 | 208 | curl_setopt($ch, CURLOPT_POSTFIELDS, $this->data); |
209 | 209 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | curl_setopt($ch, CURLOPT_TIMEOUT, 40); |
240 | 240 | set_time_limit(0); |
241 | 241 | if (!empty($this->headers)) { |
242 | - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: ' . $this->headers)); |
|
242 | + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: '.$this->headers)); |
|
243 | 243 | } |
244 | 244 | //运行curl |
245 | 245 | $data = curl_exec($ch); |
@@ -266,19 +266,19 @@ discard block |
||
266 | 266 | curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM'); |
267 | 267 | curl_setopt($ch, CURLOPT_SSLCERT, $this->cert['cert']); |
268 | 268 | curl_setopt($ch, CURLOPT_SSLKEY, $this->cert['key']); |
269 | - } else { |
|
269 | + }else { |
|
270 | 270 | if (substr($this->url, 0, 5) == 'https') { |
271 | 271 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 信任任何证书 |
272 | 272 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 检查证书中是否设置域名 |
273 | 273 | } |
274 | 274 | } |
275 | 275 | if (!empty($this->headers)) { |
276 | - curl_setopt($ch, CURLOPT_HTTPHEADER, array('content-type: ' . $this->headers)); |
|
276 | + curl_setopt($ch, CURLOPT_HTTPHEADER, array('content-type: '.$this->headers)); |
|
277 | 277 | } |
278 | - curl_setopt($ch, CURLOPT_HEADER, true); // 是否需要响应 header |
|
278 | + curl_setopt($ch, CURLOPT_HEADER, true); // 是否需要响应 header |
|
279 | 279 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
280 | 280 | $output = curl_exec($ch); |
281 | - $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); // 获得响应结果里的:头大小 |
|
281 | + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); // 获得响应结果里的:头大小 |
|
282 | 282 | $response_body = substr($output, $header_size); |
283 | 283 | curl_close($ch); |
284 | 284 | $this->output = $response_body; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $result = Db::table($this->table) |
136 | 136 | ->where('cache_name', $this->cache_name) |
137 | 137 | ->update([ |
138 | - 'cache_value' => $cache_value + $int |
|
138 | + 'cache_value' => $cache_value+$int |
|
139 | 139 | ]); |
140 | 140 | return $result ? true : false; |
141 | 141 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $result = Db::table($this->table) |
154 | 154 | ->where('cache_name', $this->cache_name) |
155 | 155 | ->update([ |
156 | - 'cache_value' => $cache_value - $int |
|
156 | + 'cache_value' => $cache_value-$int |
|
157 | 157 | ]); |
158 | 158 | return $result ? true : false; |
159 | 159 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\helper; |
23 | 23 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\helper; |
23 | 23 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\facade; |
23 | 23 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\facade; |
23 | 23 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\facade; |
23 | 23 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\facade; |
23 | 23 |