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);
3434
3535echo "== Index, changed \n" ;
3636$ 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+ }
3843$ zip ->clearError ();
3944
4045echo "== Index, unchanged \n" ;
4146$ 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 " );
4448$ zip ->clearError ();
4549fclose ($ fp );
4650
@@ -60,8 +64,7 @@ string(3) "foo"
6064int(0)
6165string(3) "foo"
6266== Index, changed
63- int(15 )
67+ bool(true )
6468== Index, unchanged
65- int(0)
66- string(3) "bar"
69+ bool(true)
6770== Done
You can’t perform that action at this time.
0 commit comments