Code comment

This commit is contained in:
Laurent Destailleur 2022-08-23 15:33:38 +02:00
parent e27133c24a
commit 900e6aaf02

View File

@ -492,14 +492,30 @@ if (!function_exists('ftp_connect')) {
//$newsection = '/./';
$newsection = ssh2_sftp_realpath($conn_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
}
//$newsection='/';
//$dirHandle = opendir("ssh2.sftp://$conn_id".$newsection);
//$dirHandle = opendir("ssh2.sftp://".intval($conn_id).ssh2_sftp_realpath($conn_id, ".").'/./');
$contents = scandir('ssh2.sftp://'.intval($conn_id).$newsection);
$buff = array();
foreach ($contents as $i => $key) {
$buff[$i] = "---------- - root root 1234 Aug 01 2000 ".$key;
}
//$i = 0;
//$handle = opendir('ssh2.sftp://'.intval($conn_id).$newsection);
//$buff=array();
//while (false !== ($file = readdir($handle))) {
// if (substr("$file", 0, 1) != "."){
// if (is_dir($file)) {
// $buff[$i]="d--------- - root root 1234 Aug 01 2000 ".$file;
// } else {
// $buff[$i]="---------- - root root 1234 Aug 01 2000 ".$file;
// }
// }
// $i++;
//}
} else {
$buff = ftp_rawlist($conn_id, $newsectioniso);
$contents = ftp_nlist($conn_id, $newsectioniso); // Sometimes rawlist fails but never nlist