Zend Framework: Zend_Ftp Component Proposal
| Proposed Component Name | Zend_Ftp |
|---|---|
| Developer Notes | http://framework.zend.com/wiki/display/ZFDEV/Zend_Ftp |
| Proposers | Steven Brown |
| Zend Liaison | TBD |
| Revision | 1.0 - 14 August 2009: Initial Draft. 1.1 - 24 August 2009: Added most of the code, ready for review. 1.2 - 19 March 2010: Added adapters (wiki revision: 16) |
Table of Contents
1. Overview
Zend_Ftp will provide utilities for connecting and managing files over FTP. It will leverage the existing PHP FTP functions and provide extended functionality.
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
- This component will allow connecting to FTP servers.
- This component will allow listing of files.
- This component will allow downloading of files.
- This component will allow uploading of files.
4. Dependencies on Other Framework Components
- Zend_Exception
5. Theory of Operation
The component provides all of the functionality you would expect from an FTP client, providing a uniform interface for the various FTP extensions.
It may be possible to automatically choose the best adapter depending on the protocol that is required and which extensions are installed.
6. Milestones / Tasks
- Milestone 1: Design notes will be published here
- Milestone 2: Working prototype checked into the incubator supporting use cases
- Milestone 3: Unit tests exist, work, and are checked into SVN.
- Milestone 4: Initial documentation exists.
7. Class Index
- Zend_Ftp
- Zend_Ftp_Exception
- Zend_Ftp_Directory
- Zend_Ftp_Directory_Exception
- Zend_Ftp_File
- Zend_Ftp_File_Exception
- Zend_Ftp_Adapter_Interface
- Zend_Ftp_Adapter_Ftp (uses ftp extension)
- Zend_Ftp_Adapter_Sftp (uses ssh extension)
- Zend_Ftp_Adapter_Ftps (uses ftp extension)
- Zend_Ftp_Adapter_Socket (plain implementation in case ftp extension is not installed)
- Zend_Ftp_Adapter_Scp (uses ssh extension)
- Zend_Ftp_Adapter_Curl (uses curl extension)
8. Use Cases
8 Comments
comments.show.hideAug 24, 2009
Thomas Weidner
Why a own base component and not an adaper for Zend_File_Transfer ?
What are the benefits of this components related to php's ftp methods ?
Aug 24, 2009
Steven Brown
"Why a own base component and not an adaper for Zend_File_Transfer ?"
There is some value in Zend_File_Transfer_Ftp in some form, however there is more to FTP than simply uploading and downloading files.
"What are the benefits of this components related to php's ftp methods ?"
Zend_Ftp makes use of PHP's FTP functions but wraps them in a friendlier interface. Most notably folders and files within a directory can be accessed as an array of objects allowing you to walk through them and perform operations.
Additionally Zend_Ftp provides functionality you often see only in desktop FTP clients, such as automatic transfer mode detection (determining ASCII or BINARY mode depending on extension), recursive CHMOD and DELETE operations, filtering file lists to show/hide hidden files, bulk transfer and bulk transfer with sync capability (compare times/sizes to only grab newer/different files).
Although everything here can be achieved with PHP's FTP functions, the result is a mass of messy lines of code compared to Zend_FTP's simple and clean interface.
Aug 25, 2009
Thomas Weidner
When you say that FTP (file transfer protocol) is not build for file transfer then I don't know why someone should use it.
Who said that Zend_File_Transfer was only build for up- and downloading for files ?
There are much more features also for the http adapter, same goes for the planned webdav and ftp adapter. As I see it, a Zend_Ftp would duplicate Zend_File_Transfer_Adapter_Ftp.
This means that eighter Zend_File_Transfer_Adapter_Ftp would be a 100% clone, or a useless wrapper.
Example: Zend_File_Transfer would be able to upload from http and then download via ftp with one call. That was the reason for using adapters. Otherwise it would have been better to go for a Zend_Http_Upload.
Only because Zend_File_Transfer is not finished for now it does not mean that other features can not be added when we see a need for them.
Mar 07, 2010
Marc Bennewitz (private)
I like the base of Zend_Ftp but it should be similar to Zend_Http.
The Zend_File_Transfer_Adapter_Ftp should be a wrapper of Zend_Ftp.
Mar 18, 2010
Steven Brown
That's a good point about the adapters I'll add that
Aug 04, 2010
Marco Kaiser
I just saw that you use eval() thats a bad idea please remove that because this can cause in script exploitation by the remote server ... :-\
Sep 01, 2010
Carl Helmertz
Please remove the @-operators as well.
Feb 08, 2011
Dolf Schimmel (Freeaqingme)
Archiving this proposal, feel free to recover it when you want to work on it again. For more details see this email.