Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

18,540 Commits

Repository files navigation

FTP protocol support for the XP Framework

Build status on GitHubXP Framework ModuleBSD LicenceRequires PHP 7.4+Supports PHP 8.0+Latest Stable Version

Userland FTP protocol implementation, no dependency on PHP's ftp extension.

Client

Example: Uploading

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();

Example: Listing

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();

About

FTP protocol support for the XP Framework

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages