1--TEST--
2Test file_get_contents() function : variation - include path testing
3--CREDITS--
4Dave Kelsey <d_kelsey@uk.ibm.com>
5--FILE--
6<?php
7echo "*** Testing file_get_contents() : variation ***\n";
8
9
10require_once('fopen_include_path.inc');
11
12// this doesn't create the include dirs in this directory
13// we change to this to ensure we are not part of the
14// include paths.
15$thisTestDir = "FileGetContentsVar2.dir";
16mkdir($thisTestDir);
17chdir($thisTestDir);
18
19$filename = 'FileGetContentsVar2.tmp';
20$scriptLocFile = __DIR__."/".$filename;
21
22$newpath = create_include_path();
23set_include_path($newpath);
24runtest();
25teardown_include_path();
26chdir("..");
27
28
29function runtest() {
30   global $scriptLocFile, $filename;
31   $h = fopen($scriptLocFile, "w");
32   fwrite($h, "File in script location");
33   fclose($h);
34   $line = file_get_contents($filename, true);
35   echo "$line\n";
36   unlink($scriptLocFile);
37}
38
39?>
40--CLEAN--
41<?php
42$thisTestDir = "FileGetContentsVar2.dir";
43// TODO Clean up tmp files?
44rmdir($thisTestDir);
45?>
46--EXPECT--
47*** Testing file_get_contents() : variation ***
48File in script location
49