A slim FTP wrapper.

0.9.3 2021-04-02 13:26 UTC

This package is auto-updated.

Last update: 2021-04-02 13:28:33 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');