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(); 30chdir(".."); 31rmdir($thisTestDir); 32 33 34function runtest() { 35 global $secondFile, $filename; 36 $h = fopen($secondFile, "w"); 37 fwrite($h, "File in include path"); 38 fclose($h); 39 readfile($filename, true); 40 echo "\n"; 41 unlink($secondFile); 42} 43 44?> 45===DONE=== 46--EXPECT-- 47*** Testing readfile() : variation *** 48File in include path 49===DONE=== 50