File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
zip /
tests /
stream_meta_data.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:05 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
stream_get_meta_data() on zip stream
--SKIPIF--
<?php
/* $Id: stream_meta_data.phpt,v 1.1.1.1 2012/02/21 23:48:05 misho Exp $ */
if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
$dirname = dirname(__FILE__) . '/';
$file = $dirname . 'test_with_comment.zip';
include $dirname . 'utils.inc';
$zip = new ZipArchive;
if (!$zip->open($file)) {
exit('failed');
}
$fp = $zip->getStream('foo');
if(!$fp) exit("\n");
var_dump(stream_get_meta_data($fp));
fclose($fp);
$zip->close();
$fp = fopen('zip://' . dirname(__FILE__) . '/test_with_comment.zip#foo', 'rb');
if (!$fp) {
exit("cannot open\n");
}
var_dump(stream_get_meta_data($fp));
fclose($fp);
?>
--EXPECTF--
array(8) {
["stream_type"]=>
string(3) "zip"
["mode"]=>
string(2) "rb"
["unread_bytes"]=>
int(0)
["seekable"]=>
bool(false)
["uri"]=>
string(3) "foo"
["timed_out"]=>
bool(false)
["blocked"]=>
bool(true)
["eof"]=>
bool(false)
}
array(9) {
["wrapper_type"]=>
string(11) "zip wrapper"
["stream_type"]=>
string(3) "zip"
["mode"]=>
string(2) "rb"
["unread_bytes"]=>
int(0)
["seekable"]=>
bool(false)
["uri"]=>
string(%d) "zip://%stest_with_comment.zip#foo"
["timed_out"]=>
bool(false)
["blocked"]=>
bool(true)
["eof"]=>
bool(false)
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>