A slim FTP wrapper.

0.9.2 2019-03-01 08:56 UTC

README

A tiny PHP FTP wrapper.

Latest Stable Version Minimum PHP Version Downloads License Build Status Scrutinizer Code Quality

List all files

$ftp = new SebastianFeldmann\Ftp\Client('ftp://user:password@example.com');
foreach ($ftp->ls() as $item) {
    echo $item->getFilename() . PHP_EOL;
}

List only directories

$ftp = new SebastianFeldmann\Ftp\Client('ftp://user:password@example.com');
foreach ($ftp->lsDirs() as $item) {
    echo $item->getFilename() . PHP_EOL;
}

List without directories

$ftp = new SebastianFeldmann\Ftp\Client('ftp://user:password@example.com');
foreach ($ftp->lsFiles() as $item) {
    echo $item->getFilename() . PHP_EOL;
}

Upload a file

$ftp = new SebastianFeldmann\Ftp\Client('ftp://user:password@example.com');
$ftp->uploadFile($pathToLocalFile, 'foo/bar/baz', 'filname.zip');