49 public function __construct($host, $port = self::DEFAULT_PORT) {
51 $this->port = (int) $port;
69 public function connect($username =
'', $password =
'', $ssl =
false) {
71 $this->ftp = @ftp_ssl_connect($this->host, $this->port);
73 $this->ftp = @ftp_connect($this->host, $this->port);
76 if (!empty($username)) {
78 if (!@ftp_login($this->ftp, $username, $password)) {
82 @ftp_pasv($this->ftp,
true);
93 @ftp_close($this->ftp);
105 return @ftp_mkdir($this->ftp, $directory);
115 return @ftp_chdir($this->ftp, $dir);
126 public function put($remote_file, $local_file, $mode = FTP_ASCII) {
127 return @ftp_put($this->ftp, $remote_file, $local_file, $mode);
138 public function get($local_file, $remote_file, $mode = FTP_ASCII) {
139 return @ftp_get($this->ftp, $local_file, $remote_file, $mode);
148 public function delete($path) {
149 return @ftp_delete($this->ftp, $path);
159 public function rename($oldname, $newname) {
160 return @ftp_rename($this->ftp, $oldname, $newname);
170 public function chmod($mode, $filename) {
171 return @ftp_chmod($this->ftp, $mode, $filename);
180 public function size($remote_file) {
181 return @ftp_size($this->ftp, $remote_file);
connect($username='', $password='', $ssl=false)
rename($oldname, $newname)
put($remote_file, $local_file, $mode=FTP_ASCII)
__construct($host, $port=self::DEFAULT_PORT)