PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Networking » Net_FTP » Bug #10068

Callback for recursive methods

Details

Request #10068Callback for recursive methods
Submitted2007-02-10 12:51 UTC
Fromjohnwarde at hotmail dot com
StatusWont fix
PackageNet_FTP
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2007-02-10 12:51 UTC] johnwarde at hotmail dot com

Description:
------------
Provide a callback to show customised progress of either a call to getRecursive() or putRecursive() methods. This would also be useful to log how far we got if the FTP connection happened to break down.

Thanks.

Test script:
---------------
i.e.

bool setRecursiveCallback($strFunction, $objToCallback = NULL)

e.g.
$objFtp = new Net_FTP($strServerName, $intPortNo);
$blnSuccess = $objFtp->setRecursiveCallback('recordCurrentFile');
...
$mixResult = $objFtp->putRecursive($strLocalDir, $strRemoteDir);

function recordCurrentFile($objFileDetails) {
// example only
echo $objFileDetails['filename'].' copied<br/>';
return true;
}

The second parameter to setRecursiveCallback() would be a reference to the object using Net_FTP.
e.g.

$objFtp->setRecursiveCallback('recordCurrentFile', $this);

class CSyncDaily {
// ...
function recordCurrentFile($objFileDetails) {
// example only
echo $objFileDetails['filename'].' copied<br/>';
return true;
}

}

Expected result:
----------------
see "Description"/"Test Script" above