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 9require_once('fopen_include_path.inc'); 10 11// this doesn't create the include dirs in this directory 12// we change to this to ensure we are not part of the 13// include paths. 14$thisTestDir = "fileGetContentsVar1.dir"; 15mkdir($thisTestDir); 16chdir($thisTestDir); 17 18$filename = "afile.txt"; 19$secondFile = $dir2."/".$filename; 20 21$newpath = create_include_path(); 22set_include_path($newpath); 23runtest(); 24teardown_include_path(); 25chdir(".."); 26 27 28function runtest() { 29 global $secondFile, $filename; 30 $h = fopen($secondFile, "w"); 31 fwrite($h, "File in include path"); 32 fclose($h); 33 $line = file_get_contents($filename, true); 34 echo "$line\n"; 35 unlink($secondFile); 36} 37 38?> 39--CLEAN-- 40<?php 41// TODO Clean up tmp files 42$thisTestDir = "fileGetContentsVar1.dir"; 43rmdir($thisTestDir); 44?> 45--EXPECT-- 46*** Testing file_get_contents() : variation *** 47File in include path 48