1--TEST--
2Test readfile() function : variation - test include path
3--CREDITS--
4Dave Kelsey <d_kelsey@uk.ibm.com>
5--FILE--
6<?php
7/* Prototype  : int readfile(string filename [, bool use_include_path[, resource context]])
8 * Description: Output a file or a URL
9 * Source code: ext/standard/file.c
10 * Alias to functions:
11 */
12
13require_once('fopen_include_path.inc');
14
15echo "*** Testing readfile() : variation ***\n";
16// this doesn't create the include dirs in this directory
17// we change to this to ensure we are not part of the
18// include paths.
19$thisTestDir = "readfileVar6.dir";
20mkdir($thisTestDir);
21chdir($thisTestDir);
22
23$filename = "afile.txt";
24$secondFile = $dir2."/".$filename;
25
26$newpath = create_include_path();
27set_include_path($newpath);
28runtest();
29teardown_include_path();
30restore_include_path();
31chdir("..");
32rmdir($thisTestDir);
33
34
35function runtest() {
36   global $secondFile, $filename;
37   $h = fopen($secondFile, "w");
38   fwrite($h, "File in include path");
39   fclose($h);
40   readfile($filename, true);
41   echo "\n";
42   unlink($secondFile);
43}
44
45?>
46===DONE===
47--EXPECT--
48*** Testing readfile() : variation ***
49File in include path
50===DONE===
51