Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions generated/8.1/functionsList.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions generated/8.1/rector-migrate.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions generated/8.2/ftp.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions generated/8.3/ftp.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions generated/8.4/ftp.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions generated/8.5/ftp.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions lib/special_cases.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Safe;

use Safe\Exceptions\ExecException;
use Safe\Exceptions\FtpException;
use Safe\Exceptions\MiscException;
use Safe\Exceptions\PosixException;
use Safe\Exceptions\SocketsException;
Expand Down Expand Up @@ -491,3 +492,25 @@ function hash_hmac_file(string $algo, string $filename, string $key, bool $binar
}
return $safeResult;
}

/**
* Sends an arbitrary command to the FTP server.
*
* @param \FTP\Connection $ftp An FTP\Connection instance.
* @param string $command The command to execute.
* @phpstan-return string[]
* @return array Returns the server's response as an array of strings.
* No parsing is performed on the response string, nor does
* ftp_raw determine if the command succeeded.
* @throws FtpException
*
*/
function ftp_raw(\FTP\Connection $ftp, string $command): array
{
error_clear_last();
$safeResult = \ftp_raw($ftp, $command);
if ($safeResult === null) {
throw FtpException::createFromPhpError();
}
return $safeResult;
}