2 allow_url_fopen disabled
9 private $data = '<?php echo "Hello World\n";?>';
11 private $stream = null;
13 function stream_open($path, $mode, $options, &$opened_path)
15 if (strpos($path, "test2://") === 0) {
16 $this->stream = fopen("test1://".substr($path, 8), $mode);
17 return !empty($this->stream);
19 if (strchr($mode, 'a'))
20 $this->pos = strlen($this->data);
27 function stream_read($count)
29 if (!empty($this->stream)) {
30 return fread($this->stream, $count);
32 $ret = substr($this->data, $this->pos, $count);
33 $this->pos += strlen($ret);
37 function stream_tell()
39 if (!empty($this->stream)) {
40 return ftell($this->stream);
47 if (!empty($this->stream)) {
48 return feof($this->stream);
50 return $this->pos >= strlen($this->data);
53 function stream_seek($offset, $whence)
55 if (!empty($this->stream)) {
56 return fseek($this->stream, $offset, $whence);
60 if ($offset < $this->data && $offset >= 0) {
69 $this->pos += $offset;
76 if (strlen($this->data) + $offset >= 0) {
77 $this->pos = strlen($this->data) + $offset;
90 stream_register_wrapper("test1", "test", STREAM_IS_URL);
91 stream_register_wrapper("test2", "test");
92 echo file_get_contents("test1://hello"),"\n";
93 include "test1://hello";
94 echo file_get_contents("test2://hello"),"\n";
95 include "test2://hello";
97 Warning: file_get_contents(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %sinclude_userstream_003.php on line 86
99 Warning: file_get_contents(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 86
102 Warning: include(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %sinclude_userstream_003.php on line 87
104 Warning: include(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 87
106 Warning: include(): Failed opening 'test1://hello' for inclusion (include_path='%s') in %sinclude_userstream_003.php on line 87
108 Warning: fopen(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %sinclude_userstream_003.php on line 10
110 Warning: fopen(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 10
112 Warning: file_get_contents(test2://hello): failed to open stream: "test::stream_open" call failed in %sinclude_userstream_003.php on line 88
115 Warning: fopen(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %sinclude_userstream_003.php on line 10
117 Warning: fopen(test1://hello): failed to open stream: no suitable wrapper could be found in %sinclude_userstream_003.php on line 10
119 Warning: include(test2://hello): failed to open stream: "test::stream_open" call failed in %sinclude_userstream_003.php on line 89
121 Warning: include(): Failed opening 'test2://hello' for inclusion (include_path='%s') in %sinclude_userstream_003.php on line 89