ZF-8669: Zend_File_Transfer: Replace constructor with factory method
Instead of the proposed patch in ZF-8668, I figured that ZFT would be better suited to have a factory() method for instantiating and returning a ZFT adapter (similar to Zend_Db::factory()). This proposed patch replaces the current constructor implementation with a Zend_Db::factory()-like factory method that accepts two parameters:
- $adapter - the name of the adapter, relative to the Zend_File_Transfer_Adapter namespace (i.e., 'http')
- $config - Either a PHP array, or Zend_Config instance, of configuration options.
The $config supports all of the options that the ZFT adapters support, and also two ZFT-specific options:
- adapter: the name of the adapter to use
- adapterNamespace: a user-defined namespace to use in place of the default 'Zend_File_Transfer_Adapter' namespace.
Side Note: I have read the proposal at http://framework.zend.com/wiki/display/… and feel that this proposed patch still fits within the guidelines. The only difference is how the adapter is gotten: the proposal incorrectly implies that a direct instantiation would return an adapter, when it cannot. Thus, the factory method. The use cases would need to be updated to reflect this change. If there is more that I need to do to have this patch accpeted, then please advise.