Home » Networking » Net_FTP » Bug #10068
Callback for recursive methods
Details
| Request #10068 | Callback for recursive methods |
|---|---|
| Submitted | 2007-02-10 12:51 UTC |
| From | johnwarde at hotmail dot com |
| Status | Wont fix |
| Package | Net_FTP |
| PHP Version | Irrelevant |
| 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