ftp_mlsd.phpt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. --TEST--
  2. ftp_mlsd() return parsed lines
  3. --EXTENSIONS--
  4. ftp
  5. pcntl
  6. --FILE--
  7. <?php
  8. require 'server.inc';
  9. $ftp = ftp_connect('127.0.0.1', $port);
  10. if (!$ftp) die("Couldn't connect to the server");
  11. var_dump(ftp_login($ftp, 'user', 'pass'));
  12. var_dump(ftp_mlsd($ftp, '.'));
  13. ftp_close($ftp);
  14. ?>
  15. --EXPECTF--
  16. bool(true)
  17. Warning: ftp_mlsd(): Missing pathname in MLSD response in %s on line %d
  18. Warning: ftp_mlsd(): Malformed fact in MLSD response in %s on line %d
  19. Warning: ftp_mlsd(): Malformed fact in MLSD response in %s on line %d
  20. array(4) {
  21. [0]=>
  22. array(8) {
  23. ["name"]=>
  24. string(1) "."
  25. ["modify"]=>
  26. string(14) "20170127230002"
  27. ["perm"]=>
  28. string(7) "flcdmpe"
  29. ["type"]=>
  30. string(4) "cdir"
  31. ["unique"]=>
  32. string(11) "811U4340002"
  33. ["UNIX.group"]=>
  34. string(2) "33"
  35. ["UNIX.mode"]=>
  36. string(4) "0755"
  37. ["UNIX.owner"]=>
  38. string(2) "33"
  39. }
  40. [1]=>
  41. array(8) {
  42. ["name"]=>
  43. string(2) ".."
  44. ["modify"]=>
  45. string(14) "20170127230002"
  46. ["perm"]=>
  47. string(7) "flcdmpe"
  48. ["type"]=>
  49. string(4) "pdir"
  50. ["unique"]=>
  51. string(11) "811U4340002"
  52. ["UNIX.group"]=>
  53. string(2) "33"
  54. ["UNIX.mode"]=>
  55. string(4) "0755"
  56. ["UNIX.owner"]=>
  57. string(2) "33"
  58. }
  59. [2]=>
  60. array(9) {
  61. ["name"]=>
  62. string(6) "foobar"
  63. ["modify"]=>
  64. string(14) "20170126121225"
  65. ["perm"]=>
  66. string(5) "adfrw"
  67. ["size"]=>
  68. string(4) "4729"
  69. ["type"]=>
  70. string(4) "file"
  71. ["unique"]=>
  72. string(11) "811U4340CB9"
  73. ["UNIX.group"]=>
  74. string(2) "33"
  75. ["UNIX.mode"]=>
  76. string(4) "0644"
  77. ["UNIX.owner"]=>
  78. string(2) "33"
  79. }
  80. [3]=>
  81. array(3) {
  82. ["name"]=>
  83. string(9) "path;name"
  84. ["fact"]=>
  85. string(6) "val=ue"
  86. ["empty"]=>
  87. string(0) ""
  88. }
  89. }