1--TEST--
2Test gzopen() function : variation: use include path and stream context create a file, relative path
3--EXTENSIONS--
4zlib
5--FILE--
6<?php
7require_once('gzopen_include_path.inc');
8
9echo "*** Testing gzopen() : variation ***\n";
10$thisTestDir = "gzopenVariation5.dir";
11mkdir($thisTestDir);
12chdir($thisTestDir);
13
14$newpath = relative_include_path();
15set_include_path($newpath);
16runtest();
17$newpath = generate_next_rel_path();
18set_include_path($newpath);
19runtest();
20
21teardown_relative_path();
22chdir("..");
23rmdir($thisTestDir);
24
25function runtest() {
26    $tmpfile = 'gzopen_variation5.tmp';
27    $h = gzopen($tmpfile, "w", true);
28    fwrite($h, "This is the test file");
29    fclose($h);
30
31
32    $h = @gzopen($tmpfile, "r");
33    if ($h === false) {
34       echo "Not created in working dir\n";
35    }
36    else {
37       echo "created in working dir\n";
38       gzclose($h);
39       unlink($tmpfile);
40    }
41
42    $h = @gzopen('dir1/'.$tmpfile, "r");
43    if ($h === false) {
44       echo "Not created in dir1\n";
45    }
46    else {
47       echo "created in dir1\n";
48       gzclose($h);
49       unlink('dir1/'.$tmpfile);
50    }
51}
52?>
53--EXPECT--
54*** Testing gzopen() : variation ***
55created in working dir
56Not created in dir1
57created in working dir
58Not created in dir1
59