diff --git a/FtpAdapter.php b/FtpAdapter.php index bdabfc7..9d9045d 100644 --- a/FtpAdapter.php +++ b/FtpAdapter.php @@ -94,10 +94,10 @@ private function connection() return $this->connection; } - if ($this->connectivityChecker->isConnected($this->connection) === false) { - $this->connection = false; - goto start; - } + if ($this->connectivityChecker->isConnected($this->connection) === false) { + $this->connection = false; + goto start; + } ftp_chdir($this->connection, $this->rootDirectory); diff --git a/NoopCommandConnectivityChecker.php b/NoopCommandConnectivityChecker.php index fe43822..862b712 100644 --- a/NoopCommandConnectivityChecker.php +++ b/NoopCommandConnectivityChecker.php @@ -19,7 +19,8 @@ public function isConnected($connection): bool } // @codeCoverageIgnoreEnd - $responseCode = $response ? (int) preg_replace('/\D/', '', implode('', $response)) : false; + //$responseCode = $response ? (int) preg_replace('/\D/', '', implode('', $response)) : false; + $responseCode = $response ? (int) substr(implode('', $response), 0, 3) : false; return $responseCode === 200; } diff --git a/README.md b/README.md index d8a2aea..e9e555f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > ⚠️ this is a sub-split, for pull requests and issues, visit: https://github.com/thephpleague/flysystem ```bash -composer require league/flysystem-ftp +composer require dalimov/flysystem-ftp ``` View the [documentation](https://flysystem.thephpleague.com/docs/adapter/ftp/).