Annotation of embedaddon/php/ext/standard/tests/file/fopen_variation6.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test fopen() function : variation: use include path and stream context relative/absolute file
3: --CREDITS--
4: Dave Kelsey <d_kelsey@uk.ibm.com>
5: --FILE--
6: <?php
7: /* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
8: * Description: Open a file or a URL and return a file pointer
9: * Source code: ext/standard/file.c
10: * Alias to functions:
11: */
12:
13: echo "*** Testing fopen() : variation ***\n";
14: $absfile = __FILE__.'.tmp';
15: $relfile = "fopen_variation6.tmp";
16:
17: $h = fopen($absfile, "w");
18: fwrite($h, "This is an absolute file");
19: fclose($h);
20:
21: $h = fopen($relfile, "w");
22: fwrite($h, "This is a relative file");
23: fclose($h);
24:
25: $ctx = stream_context_create();
26: $h = fopen($absfile, "r", true, $ctx);
27: fpassthru($h);
28: fclose($h);
29: echo "\n";
30:
31: $h = fopen($relfile, "r", true, $ctx);
32: fpassthru($h);
33: fclose($h);
34: echo "\n";
35:
36: unlink($absfile);
37: unlink($relfile);
38: ?>
39: ===DONE===
40: --EXPECTF--
41: *** Testing fopen() : variation ***
42: This is an absolute file
43: This is a relative file
44: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>