Userland FTP protocol implementation, no dependency on PHP's ftp extension.
usepeer\ftp\{FtpConnection, FtpTransfer};
useio\File;
$c= (newFtpConnection('ftp://user:pass@example.com/'))->connect();
// Upload logo.png to the connection's root directory$c->rootDir()->file('logo.png')->uploadFrom(newFile('logo.png'));
// Upload from a stream using ASCII mode$c->rootDir()->file('README.md')->uploadFrom(
newMemoryInputStream('Read me first!'),
FtpTransfer::ASCII
);
$c->close();usepeer\ftp\FtpConnection;
$c= (newFtpConnection('ftp://user:pass@example.com/'))->connect();
// List root directory's contentsforeach ($c->rootDir()->entries() as$entry) {
Console::writeLine('- ', $entry);
}
$c->close();
