oihana/php-ftp
Composer 安装命令:
composer require oihana/php-ftp
包简介
The Oihana PHP FTP library - a modern, strongly-typed FTP/FTPS client
README 文档
README
A modern, strongly-typed FTP / FTPS client for PHP 8.4+, built in the spirit of the oihana/php-* libraries.
🚀 Features
- 🔌 FTP & FTPS (explicit TLS) over the native
ext-ftpextension — zero runtime dependencies. - 🧩 Trait-composed client with a clean, mockable driver layer (
FtpDriverInterface) — SFTP-ready by design. - 🔑 Authentication & security as first-class concerns: credentials are wiped from memory, secrets are never logged.
- 📁 File & directory operations: upload, download, append, delete, rename, listing (MLSD/raw),
chmod, recursive helpers. - 🧱 Constant enums everywhere — no magic strings for config keys, transfer modes or connection options.
- 🪵 PSR-3 logging (optional) with retry + exponential backoff on transient failures.
- 🔐 Seamless reuse of
oihana/php-filespath/MIME helpers and OpenSSL file encryption. - 🧪 Full unit-test coverage through the mockable driver — no live server required.
💡 Designed to be lightweight, testable, and compatible with any PHP 8.4+ project.
📦 Installation
Requires PHP 8.4+ with the
ext-ftpextension.
Install via Composer:
composer require oihana/php-ftp
✅ Tests & coverage
Run the full unit-test suite (PHPUnit, strict mode):
composer test
Measure coverage (requires Xdebug or PCOV):
composer coverage # text + Clover + HTML under build/coverage/ composer coverage:md # readable Markdown summary (build/coverage/COVERAGE.md)
All transport calls go through FtpDriverInterface, so the suite reaches full
coverage by mocking an in-memory driver — no real FTP server is needed. See
CONTRIBUTING.md for the testing philosophy.
🧾 License
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0).
👤 About the author
- Author : Marc ALCARAZ (aka eKameleon)
- Mail : marc@ooop.fr
- Website : http://www.ooop.fr
🛠️ Generate the Documentation
We use phpDocumentor to generate the API documentation into the ./docs folder.
composer doc
🔗 Related packages
oihana/php-files– file, path and OpenSSL helpers reused by this library:https://github.com/BcommeBois/oihana-php-filesoihana/php-core– core helpers and utilities:https://github.com/BcommeBois/oihana-php-coreoihana/php-reflect– reflection and hydration utilities:https://github.com/BcommeBois/oihana-php-reflectoihana/php-enums– strongly-typed constant enumerations for PHP:https://github.com/BcommeBois/oihana-php-enums
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MPL-2.0
- 更新时间: 2026-06-30
