PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

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