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