<?php ftp_close(FTP\Connection $ftp): bool
<?php public function __destruct() { if (is_resource($this->connection)) { @ftp_close($this->connection); } $this->connection = false; }
<?php $this->ignorePassiveAddress($options, $connection); $this->makeConnectionPassive($options, $connection); } catch (FtpConnectionException $exception) { ftp_close($connection); throw $exception; }
<?php $this->runScenario(function () use ($options) { $connection = $this->connectionProvider->createConnection($options); $this->assertIsResource($connection); $this->assertTrue(ftp_close($connection)); }); }
<?php $this->runScenario(function () use ($options) { $connection = (new FtpConnectionProvider())->createConnection($options); ftp_close($connection); $connected = (new NoopCommandConnectivityChecker())->isConnected($connection);
<?php $connection = $provider->createConnection($options); $connectedChecker = new RawListFtpConnectivityChecker(); $this->assertTrue($connectedChecker->isConnected($connection)); @ftp_close($connection); $this->assertFalse($connectedChecker->isConnected($connection)); }); }