@@ -44,13 +44,13 @@ |
||
44 | 44 | C::assertFunction('ssh2_connect', '请开启 ssh2 扩展'); |
45 | 45 | C::assertTrue(Arrays::keyExistsAll(['host', 'username', 'password'], $config, $diff), '缺少 ' . implode(',', $diff) . ' 参数'); |
46 | 46 | $this->_conn = ssh2_connect( |
47 | - (string) I::get($config, 'host'), |
|
48 | - (int) I::get($config, 'port', 22), |
|
49 | - (array) I::get($config, 'methods', []), |
|
50 | - (array) I::get($config, 'callback', []) |
|
47 | + (string)I::get($config, 'host'), |
|
48 | + (int)I::get($config, 'port', 22), |
|
49 | + (array)I::get($config, 'methods', []), |
|
50 | + (array)I::get($config, 'callback', []) |
|
51 | 51 | ); |
52 | 52 | C::assertNotFalse($this->_conn, '连接失败'); |
53 | - C::assertNotFalse(ssh2_auth_password($this->_conn, (string) I::get($config, 'username'), (string) I::get($config, 'password')), '账号密码错误'); |
|
53 | + C::assertNotFalse(ssh2_auth_password($this->_conn, (string)I::get($config, 'username'), (string)I::get($config, 'password')), '账号密码错误'); |
|
54 | 54 | $this->_sftp = ssh2_sftp($this->_conn); |
55 | 55 | C::assertNotFalse($this->_sftp, '初始化 sftp 失败'); |
56 | 56 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function isAjax() |
188 | 188 | { |
189 | - return 'XMLHttpRequest' === Arrays::first((array) I::get($this->getHeaders(), 'x-requested-with', [])); |
|
189 | + return 'XMLHttpRequest' === Arrays::first((array)I::get($this->getHeaders(), 'x-requested-with', [])); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $secure = $this->isSecureConnection(); |
382 | 382 | $http = $secure ? 'https' : 'http'; |
383 | 383 | if (I::get($this->getHeaders(), 'x-forwarded-host')) { |
384 | - $this->__hostInfo = $http . '://' . trim((string) Arrays::first(explode(',', (string) Arrays::first((array) I::get($this->getHeaders(), 'x-forward-host', []))))); |
|
384 | + $this->__hostInfo = $http . '://' . trim((string)Arrays::first(explode(',', (string)Arrays::first((array)I::get($this->getHeaders(), 'x-forward-host', []))))); |
|
385 | 385 | } elseif (I::get($this->getHeaders(), 'host')) { |
386 | 386 | $this->__hostInfo = $http . '://' . Arrays::first(I::get($this->getHeaders(), 'host')); |
387 | 387 | } elseif (isset($_SERVER['SERVER_NAME'])) { |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | */ |
465 | 465 | public function getQueryString() |
466 | 466 | { |
467 | - return (string) I::get($_SERVER, 'QUERY_STRING', ''); |
|
467 | + return (string)I::get($_SERVER, 'QUERY_STRING', ''); |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | /** |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | return true; |
479 | 479 | } |
480 | 480 | foreach ($this->__secureProtocolHeaders as $header => $values) { |
481 | - if (($headerValue = (string) I::get($this->getHeaders(), $header)) !== null) { |
|
481 | + if (($headerValue = (string)I::get($this->getHeaders(), $header)) !== null) { |
|
482 | 482 | foreach ($values as $value) { |
483 | 483 | if (strcasecmp($headerValue, $value) === 0) { |
484 | 484 | return true; |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | */ |
498 | 498 | public function getServerName() |
499 | 499 | { |
500 | - return (string) I::get($_SERVER, 'SERVER_NAME'); |
|
500 | + return (string)I::get($_SERVER, 'SERVER_NAME'); |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | /** |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | */ |
508 | 508 | public function getServerPort() |
509 | 509 | { |
510 | - return (int) I::get($_SERVER, 'SERVER_PORT'); |
|
510 | + return (int)I::get($_SERVER, 'SERVER_PORT'); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | /** |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | */ |
563 | 563 | public function getRemoteIP() |
564 | 564 | { |
565 | - return (string) I::get($_SERVER, 'REMOTE_ADDR'); |
|
565 | + return (string)I::get($_SERVER, 'REMOTE_ADDR'); |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | /** |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | */ |
573 | 573 | public function getRemoteHost() |
574 | 574 | { |
575 | - return (string) I::get($_SERVER, 'REMOTE_HOST'); |
|
575 | + return (string)I::get($_SERVER, 'REMOTE_HOST'); |
|
576 | 576 | } |
577 | 577 | |
578 | 578 | /** |