diff --git a/readme.md b/readme.md index 756b312..a954892 100644 --- a/readme.md +++ b/readme.md @@ -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 @@ -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(); diff --git a/src/Ftp.php b/src/Ftp.php index cd91838..d9094a9 100644 --- a/src/Ftp.php +++ b/src/Ftp.php @@ -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',