summaryrefslogtreecommitdiff
path: root/ext/ftp/tests/ftp_mlsd.phpt
blob: 85da6b8028f3b243f5ed19f2f6048a56ecb0c6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--TEST--
ftp_mlsd() return parsed lines
--SKIPIF--
<?php
require 'skipif.inc';
?>
--FILE--
<?php
require 'server.inc';

$ftp = ftp_connect('127.0.0.1', $port);
if (!$ftp) die("Couldn't connect to the server");

var_dump(ftp_login($ftp, 'user', 'pass'));

var_dump(ftp_mlsd($ftp, '.'));

ftp_close($ftp);
?>
--EXPECTF--
bool(true)

Warning: ftp_mlsd(): Missing pathname in MLSD response in %s on line %d

Warning: ftp_mlsd(): Malformed fact in MLSD response in %s on line %d

Warning: ftp_mlsd(): Malformed fact in MLSD response in %s on line %d
array(4) {
  [0]=>
  array(8) {
    ["name"]=>
    string(1) "."
    ["modify"]=>
    string(14) "20170127230002"
    ["perm"]=>
    string(7) "flcdmpe"
    ["type"]=>
    string(4) "cdir"
    ["unique"]=>
    string(11) "811U4340002"
    ["UNIX.group"]=>
    string(2) "33"
    ["UNIX.mode"]=>
    string(4) "0755"
    ["UNIX.owner"]=>
    string(2) "33"
  }
  [1]=>
  array(8) {
    ["name"]=>
    string(2) ".."
    ["modify"]=>
    string(14) "20170127230002"
    ["perm"]=>
    string(7) "flcdmpe"
    ["type"]=>
    string(4) "pdir"
    ["unique"]=>
    string(11) "811U4340002"
    ["UNIX.group"]=>
    string(2) "33"
    ["UNIX.mode"]=>
    string(4) "0755"
    ["UNIX.owner"]=>
    string(2) "33"
  }
  [2]=>
  array(9) {
    ["name"]=>
    string(6) "foobar"
    ["modify"]=>
    string(14) "20170126121225"
    ["perm"]=>
    string(5) "adfrw"
    ["size"]=>
    string(4) "4729"
    ["type"]=>
    string(4) "file"
    ["unique"]=>
    string(11) "811U4340CB9"
    ["UNIX.group"]=>
    string(2) "33"
    ["UNIX.mode"]=>
    string(4) "0644"
    ["UNIX.owner"]=>
    string(2) "33"
  }
  [3]=>
  array(3) {
    ["name"]=>
    string(9) "path;name"
    ["fact"]=>
    string(6) "val=ue"
    ["empty"]=>
    string(0) ""
  }
}