php-wrappers
High-performance wrappers for native FTP and SFTP functions., (*1)
Usage
Why?
The default PHP ftp:// wrapper closes your connections immediately after use which has a side-effect of slowing down your scripts if doing multiple requests. This wrapper replacement holds your connections open (sessions) until the scripts terminates so you can transfer files at a much faster rate., (*2)
You can use almost all native PHP functions with this wrapper., (*3)
ftps:// and sftp:// are also supported with FtpsStream and SftpStream (for SFTP, you'll need to enable the ssh2 extension)., (*4)
, (*5)
(Lower is better), (*6)
You can run benchmarks using tests/benchmark.php., (*7)
Methods
<?php
var_dump(FtpStream::is_registered()); // Returns true if the wrapper is already registered
FtpStream::register(); // Register the wrapper
FtpStream::unregister(); // Restore the default wrapper
FtpStream::close_all(); // Closes all connections before the end of the script