ftp

class untuk FTP atau file transfer protocol

includes/class/ftp.php

ftp

class untuk FTP atau file transfer protocol

Contoh Penggunaan:

$config = array(
  'hostname' => 'example.com',
 'username' => 'example',
 'password' => 'secret',
# 'port'     => 21,
# 'passive'  => true
 );
$ftp = _class('ftp', $config);
$ftp->connect();
$ftp->changedir('storage');
$r = $ftp->list_files();
pr($r, 'ada koneksi');

initialize

Menentukan Array untuk login ke FTP Server

initialize($config = array());

connect

connect ke server FTP sebelum menggunakan method method yang sudah tersedia

connect($config = array());

changedir

mengganti posisi fokus ke folder atau directory tertentu

changedir($path = '', $supress_debug = FALSE);

mkdir

membuat directory

mkdir($path = '', $permissions = NULL);

upload

meng-upload file

upload($locpath, $rempath, $mode = 'auto', $permissions = NULL);

rename

merubah nama file

rename($old_file, $new_file, $move = FALSE);

move

memindah file dalam Server FTP

move($old_file, $new_file);

delete_file

menghapus file

delete_file($filepath);

delete_dir

menghapus directory

delete_dir($filepath);

chmod

mengubah permission file

chmod($path, $perm);

list_files

melihat daftar file yang ada di server FTP

list_files($path = '.');

mirror

meng-syncronkan dari path server FTP ke path lokal

mirror($locpath, $rempath);

close

menutup koneksi dengan me-release memory yang ada di server

close();