Skip to content

Commit

Permalink
PascalCase constants (BC break)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jul 17, 2023
1 parent 81bea7c commit 32a2631
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $ftp->login($username, $password);
Upload the file

```php
$ftp->put($destination_file, $source_file, FTP_BINARY);
$ftp->put($destination_file, $source_file, Ftp::Binary);
```

Close the FTP stream
Expand All @@ -55,7 +55,7 @@ try {
$ftp = new Ftp;
$ftp->connect($host);
$ftp->login($username, $password);
$ftp->put($destination_file, $source_file, FTP_BINARY);
$ftp->put($destination_file, $source_file, Ftp::Binary);

} catch (FtpException $e) {
echo 'Error: ', $e->getMessage();
Expand Down
27 changes: 15 additions & 12 deletions src/Ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,22 @@
*/
class Ftp
{
/**#@+ FTP constant alias */
public const ASCII = FTP_ASCII;
public const TEXT = FTP_TEXT;
public const BINARY = FTP_BINARY;
public const IMAGE = FTP_IMAGE;
public const TIMEOUT_SEC = FTP_TIMEOUT_SEC;
public const AUTOSEEK = FTP_AUTOSEEK;
public const AUTORESUME = FTP_AUTORESUME;
public const FAILED = FTP_FAILED;
public const FINISHED = FTP_FINISHED;
public const MOREDATA = FTP_MOREDATA;

/**#@-*/
public const Text = FTP_TEXT;
public const Binary = FTP_BINARY;
public const Image = FTP_IMAGE;
public const Timeout = FTP_TIMEOUT_SEC;
public const AutoSeek = FTP_AUTOSEEK;
public const AutoResume = FTP_AUTORESUME;
public const Failed = FTP_FAILED;
public const Finished = FTP_FINISHED;
public const MoreData = FTP_MOREDATA;

/** @deprecated */
public const BINARY = self::Binary;

/** @deprecated */
public const TEXT = self::Text;

private const Aliases = [
'sslconnect' => 'ssl_connect',
Expand Down

0 comments on commit 32a2631

Please sign in to comment.