Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xp-framework/ftp
FTP protocol support for the XP Framework
https://github.com/xp-framework/ftp
client ftp php php7 php8 server xp-framework
Last synced: about 13 hours ago
JSON representation
FTP protocol support for the XP Framework
- Host: GitHub
- URL: https://github.com/xp-framework/ftp
- Owner: xp-framework
- Created: 2013-11-12T11:06:40.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-03-24T10:37:09.000Z (8 months ago)
- Last Synced: 2024-04-26T01:41:28.247Z (7 months ago)
- Topics: client, ftp, php, php7, php8, server, xp-framework
- Language: PHP
- Homepage:
- Size: 3.29 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
Awesome Lists containing this project
README
FTP protocol support for the XP Framework
========================================================================[![Build status on GitHub](https://github.com/xp-framework/ftp/workflows/Tests/badge.svg)](https://github.com/xp-framework/ftp/actions)
[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)
[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)
[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)
[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)
[![Latest Stable Version](https://poser.pugx.org/xp-framework/ftp/version.png)](https://packagist.org/packages/xp-framework/ftp)Userland FTP protocol implementation, no dependency on PHP's *ftp* extension.
Client
------### Example: Uploading
```php
use peer\ftp\{FtpConnection, FtpTransfer};
use io\File;$c= (new FtpConnection('ftp://user:[email protected]/'))->connect();
// Upload logo.png to the connection's root directory
$c->rootDir()->file('logo.png')->uploadFrom(new File('logo.png'));// Upload from a stream using ASCII mode
$c->rootDir()->file('README.md')->uploadFrom(
new MemoryInputStream('Read me first!'),
FtpTransfer::ASCII
);$c->close();
```### Example: Listing
```php
use peer\ftp\FtpConnection;$c= (new FtpConnection('ftp://user:[email protected]/'))->connect();
// List root directory's contents
foreach ($c->rootDir()->entries() as $entry) {
Console::writeLine('- ', $entry);
}$c->close();
```