1--TEST--
2Test readfile() function : variation
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 = "readfileVar7.dir";
20mkdir($thisTestDir);
21chdir($thisTestDir);
22
23$filename = "readFileVar7.tmp";
24$scriptLocFile = dirname(__FILE__)."/".$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 $scriptLocFile, $filename;
37   $h = fopen($scriptLocFile, "w");
38   fwrite($h, "File in script location");
39   fclose($h);
40   readfile($filename, true);
41   echo "\n";
42   unlink($scriptLocFile);
43}
44
45?>
46===DONE===
47--EXPECT--
48*** Testing readfile() : variation ***
49File in script location
50===DONE===
51