2 Test gzfile() function : variation: use include path (relative directories in path)
5 if (!extension_loaded("zlib")) {
6 print "skip - ZLIB extension not loaded";
11 require_once('reading_include_path.inc');
13 //define the files to go into these directories, create one in dir2
14 set_include_path($newIncludePath);
16 restore_include_path();
18 // remove the directory structure
21 foreach($newdirs as $newdir) {
28 function test_gzfile() {
29 global $scriptFile, $secondFile, $firstFile, $filename;
31 // create a file in the middle directory
32 $h = gzopen($secondFile, "w");
33 gzwrite($h, "This is a file in dir2");
36 // should read dir2 file
37 var_dump(gzfile($filename, true));
40 //create a file in dir1
41 $h = gzopen($firstFile, "w");
42 gzwrite($h, "This is a file in dir1");
45 //should now read dir1 file
46 var_dump(gzfile($filename, true));
49 // create a file in working directory
50 $h = gzopen($filename, "w");
51 gzwrite($h, "This is a file in working dir");
54 //should still read dir1 file
55 var_dump(gzfile($filename, true));
61 //should read the file in working directory
62 var_dump(gzfile($filename, true));
65 // create a file in the script directory
66 $h = gzopen($scriptFile, "w");
67 gzwrite($h, "This is a file in script dir");
70 //should read the file in script dir
71 var_dump(gzfile($filename, true));
85 string(22) "This is a file in dir2"
90 string(22) "This is a file in dir1"
95 string(22) "This is a file in dir1"
100 string(29) "This is a file in working dir"
105 string(28) "This is a file in script dir"