File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,17 @@ fclose($fp);
34
34
35
35
echo "== Index, changed \n" ;
36
36
$ fp = $ zip ->getStreamIndex (1 );
37
- var_dump ($ zip ->status );
37
+ if (version_compare (ZipArchive::LIBZIP_VERSION , "1.10.0 " , "< " )) {
38
+ /* not supported in old version */
39
+ var_dump ($ zip ->status === ZipArchive::ER_CHANGED );
40
+ } else {
41
+ var_dump ($ zip ->status === 0 && stream_get_contents ($ fp ) === "baz " );
42
+ }
38
43
$ zip ->clearError ();
39
44
40
45
echo "== Index, unchanged \n" ;
41
46
$ fp = $ zip ->getStreamIndex (1 , ZipArchive::FL_UNCHANGED );
42
- var_dump ($ zip ->status );
43
- var_dump (stream_get_contents ($ fp ));
47
+ var_dump ($ zip ->status === 0 && stream_get_contents ($ fp ) === "bar " );
44
48
$ zip ->clearError ();
45
49
fclose ($ fp );
46
50
@@ -60,8 +64,7 @@ string(3) "foo"
60
64
int(0)
61
65
string(3) "foo"
62
66
== Index, changed
63
- int(15 )
67
+ bool(true )
64
68
== Index, unchanged
65
- int(0)
66
- string(3) "bar"
69
+ bool(true)
67
70
== Done
You can’t perform that action at this time.
0 commit comments