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(".."); 27rmdir($thisTestDir); 28 29 30function runtest() { 31 global $scriptLocFile, $filename; 32 $h = fopen($scriptLocFile, "w"); 33 fwrite($h, "File in script location"); 34 fclose($h); 35 $line = file_get_contents($filename, true); 36 echo "$line\n"; 37 unlink($scriptLocFile); 38} 39 40?> 41--EXPECT-- 42*** Testing file_get_contents() : variation *** 43File in script location 44