2006-05-14 00:40:53 +00:00
|
|
|
--TEST--
|
|
|
|
Stream: RFC2397 getting meta data
|
2008-03-08 19:12:41 +00:00
|
|
|
--INI--
|
|
|
|
allow_url_fopen=1
|
2006-05-14 00:40:53 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$streams = array(
|
|
|
|
'data://,',
|
|
|
|
'data://',
|
|
|
|
'data://;base64,',
|
|
|
|
'data://;base64',
|
|
|
|
'data://foo,',
|
|
|
|
'data://foo=bar,',
|
|
|
|
'data://text/plain,',
|
|
|
|
'data://text/plain;foo,',
|
|
|
|
'data://text/plain;foo=bar,',
|
|
|
|
'data://text/plain;foo=bar;bla,',
|
|
|
|
'data://text/plain;foo=bar;base64,',
|
|
|
|
'data://text/plain;foo=bar;bar=baz',
|
|
|
|
'data://text/plain;foo=bar;bar=baz,',
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach($streams as $stream)
|
|
|
|
{
|
|
|
|
$stream = fopen($stream, 'r');
|
|
|
|
$meta = @stream_get_meta_data($stream);
|
|
|
|
var_dump($meta);
|
|
|
|
var_dump(isset($meta['foo']) ? $meta['foo'] : null);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
===DONE===
|
|
|
|
<?php exit(0); ?>
|
|
|
|
--EXPECTF--
|
2006-06-29 14:53:31 +00:00
|
|
|
array(8) {
|
|
|
|
[u"wrapper_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"stream_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mode"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(1) "r"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"unread_bytes"]=>
|
|
|
|
int(0)
|
|
|
|
[u"unread_chars"]=>
|
|
|
|
int(0)
|
|
|
|
[u"seekable"]=>
|
|
|
|
bool(true)
|
|
|
|
[u"uri"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(8) "data://,"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"base64"]=>
|
|
|
|
bool(false)
|
|
|
|
}
|
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: fopen(data://): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
|
2009-04-25 21:12:23 +00:00
|
|
|
NULL
|
2006-06-29 14:53:31 +00:00
|
|
|
NULL
|
|
|
|
array(8) {
|
|
|
|
[u"wrapper_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"stream_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mode"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(1) "r"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"unread_bytes"]=>
|
|
|
|
int(0)
|
|
|
|
[u"unread_chars"]=>
|
|
|
|
int(0)
|
|
|
|
[u"seekable"]=>
|
|
|
|
bool(true)
|
|
|
|
[u"uri"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(15) "data://;base64,"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"base64"]=>
|
|
|
|
bool(true)
|
|
|
|
}
|
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: fopen(data://;base64): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
|
2009-04-25 21:12:23 +00:00
|
|
|
NULL
|
2006-06-29 14:53:31 +00:00
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: fopen(data://foo,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d
|
2009-04-25 21:12:23 +00:00
|
|
|
NULL
|
2006-06-29 14:53:31 +00:00
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: fopen(data://foo=bar,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d
|
2009-04-25 21:12:23 +00:00
|
|
|
NULL
|
2006-06-29 14:53:31 +00:00
|
|
|
NULL
|
|
|
|
array(9) {
|
|
|
|
[u"wrapper_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"stream_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mode"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(1) "r"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"unread_bytes"]=>
|
|
|
|
int(0)
|
|
|
|
[u"unread_chars"]=>
|
|
|
|
int(0)
|
|
|
|
[u"seekable"]=>
|
|
|
|
bool(true)
|
|
|
|
[u"uri"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(18) "data://text/plain,"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mediatype"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(10) "text/plain"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"base64"]=>
|
|
|
|
bool(false)
|
|
|
|
}
|
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: fopen(data://text/plain;foo,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d
|
2009-04-25 21:12:23 +00:00
|
|
|
NULL
|
2006-06-29 14:53:31 +00:00
|
|
|
NULL
|
|
|
|
array(10) {
|
|
|
|
[u"wrapper_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"stream_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mode"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(1) "r"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"unread_bytes"]=>
|
|
|
|
int(0)
|
|
|
|
[u"unread_chars"]=>
|
|
|
|
int(0)
|
|
|
|
[u"seekable"]=>
|
|
|
|
bool(true)
|
|
|
|
[u"uri"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(26) "data://text/plain;foo=bar,"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mediatype"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(10) "text/plain"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"foo"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(3) "bar"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"base64"]=>
|
|
|
|
bool(false)
|
|
|
|
}
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(3) "bar"
|
2006-06-29 14:53:31 +00:00
|
|
|
|
|
|
|
Warning: fopen(data://text/plain;foo=bar;bla,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d
|
2009-04-25 21:12:23 +00:00
|
|
|
NULL
|
2006-06-29 14:53:31 +00:00
|
|
|
NULL
|
|
|
|
array(10) {
|
|
|
|
[u"wrapper_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"stream_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mode"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(1) "r"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"unread_bytes"]=>
|
|
|
|
int(0)
|
|
|
|
[u"unread_chars"]=>
|
|
|
|
int(0)
|
|
|
|
[u"seekable"]=>
|
|
|
|
bool(true)
|
|
|
|
[u"uri"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(33) "data://text/plain;foo=bar;base64,"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mediatype"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(10) "text/plain"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"foo"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(3) "bar"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"base64"]=>
|
|
|
|
bool(true)
|
|
|
|
}
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(3) "bar"
|
2006-06-29 14:53:31 +00:00
|
|
|
|
|
|
|
Warning: fopen(data://text/plain;foo=bar;bar=baz): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
|
2009-04-25 21:12:23 +00:00
|
|
|
NULL
|
2006-06-29 14:53:31 +00:00
|
|
|
NULL
|
|
|
|
array(11) {
|
|
|
|
[u"wrapper_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"stream_type"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(7) "RFC2397"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mode"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(1) "r"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"unread_bytes"]=>
|
|
|
|
int(0)
|
|
|
|
[u"unread_chars"]=>
|
|
|
|
int(0)
|
|
|
|
[u"seekable"]=>
|
|
|
|
bool(true)
|
|
|
|
[u"uri"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(34) "data://text/plain;foo=bar;bar=baz,"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"mediatype"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(10) "text/plain"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"foo"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(3) "bar"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"bar"]=>
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(3) "baz"
|
2006-06-29 14:53:31 +00:00
|
|
|
[u"base64"]=>
|
|
|
|
bool(false)
|
|
|
|
}
|
2006-09-21 19:53:10 +00:00
|
|
|
unicode(3) "bar"
|
2006-06-29 14:53:31 +00:00
|
|
|
===DONE===
|