FTP API Rewrite

at 2009-05-17 in Announcements by friebe (0 comments)

The old FTP API used PHP's ftp extension. This had limitations that expressed themselves when using the streaming capabilities:

  $file= $conn->rootDir()->getDir('htdocs')->getFile('index.html');
with
($stream= $file->getInputStream()); {
while
($stream->available()) {
Console::write
($stream->read());
}
}

This code worked as expected but made the connection unusable thereafter. This was due to the fact that streaming requires using ftp_raw() commands and we needed to read two lines (150 opening XXX mode connection and 226 transfer complete), which is not supported. This messes up the internal state maintained in the implementation's stack.

Because FTP is a drop-dead simple protocol, current head now contains a complete rewrite of the FTP api to use pure sockets. At the same time, there is no longer a dependency on the ftp extension.



Subscribe

You can subscribe to the XP framework's news by using RSS syndication.


Categories

News
General
PHP5
Announcements
RFCs
Further reading
Examples
Editorial
EASC
Experiments
Unittests
Databases
5.8-SERIES
Unicode
Language
5.9-SERIES

Related

Find related articles by a search for «FTP».