blob: 5a4fefae065e2c8f36e191a037d96b5448ef6dce (
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
|
--TEST--
Check for stream
--SKIPIF--
<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
--FILE--
<?php
$n = "rpm://" . __DIR__ . "/bidon.rpm#/usr/share/doc/bidon/README";
var_dump(in_array('rpm', stream_get_wrappers()));
var_dump($f = fopen($n, "r"));
var_dump(trim(fread($f, 10)));
var_dump(feof($f));
var_dump(trim(fread($f, 100)));
var_dump(feof($f));
fclose($f);
var_dump(trim(file_get_contents($n)));
var_dump(file_get_contents(str_replace('README', 'TODO', $n)));
?>
Done
--EXPECTF--
bool(true)
resource(%d) of type (stream)
string(10) "Mon Feb 12"
bool(false)
string(17) "13:27:47 CET 2018"
bool(true)
string(28) "Mon Feb 12 13:27:47 CET 2018"
Warning: file_get_contents(%s/bidon.rpm#/usr/share/doc/bidon/TODO): Failed to open stream: operation failed in %s on line %d
bool(false)
Done
|