1--TEST--
2Test file_get_contents() and file_put_contents() functions : usage variations - use_include_path
3--FILE--
4<?php
5
6/* Testing variation using use_include_path argument */
7$file_path = __DIR__;
8include($file_path."/file.inc");
9
10echo "*** Testing with variation in use_include_path argument ***\n";
11$dir = "file_get_contents_variation2";
12mkdir($file_path."/".$dir);
13$filename = $file_path."/".$dir."/"."file_get_contents_variation2.tmp";
14
15ini_set( 'include_path',$file_path."/".$dir );
16
17$data_array = array( 1, "  Data1 in an array", 2, "  Data2 in an array" );
18fill_buffer( $buffer, "text", 100);
19file_put_contents( $filename, $buffer );
20fill_buffer( $buffer, "numeric", 100);
21file_put_contents( $filename, $buffer, FILE_APPEND, NULL );
22file_put_contents( $filename, $data_array, FILE_APPEND, NULL );
23var_dump( file_get_contents($filename, 0) );
24var_dump( file_get_contents($filename, 1) );
25var_dump( file_get_contents($filename, 0, NULL, 5) );
26var_dump( file_get_contents($filename, 1, NULL, 5) );
27var_dump( file_get_contents($filename, 0, NULL, 5, 20) );
28var_dump( file_get_contents($filename, 1, NULL, 5, 20) );
29
30echo "--- Done ---";
31?>
32--CLEAN--
33<?php
34//Deleting the temporary files and directory used in the testcase
35
36$file_path = __DIR__;
37unlink($file_path."/file_get_contents_variation2/file_get_contents_variation2.tmp");
38rmdir($file_path."/file_get_contents_variation2");
39?>
40--EXPECT--
41*** Testing with variation in use_include_path argument ***
42string(240) "text text text text text text text text text text text text text text text text text text text text 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221  Data1 in an array2  Data2 in an array"
43string(240) "text text text text text text text text text text text text text text text text text text text text 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221  Data1 in an array2  Data2 in an array"
44string(235) "text text text text text text text text text text text text text text text text text text text 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221  Data1 in an array2  Data2 in an array"
45string(235) "text text text text text text text text text text text text text text text text text text text 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221  Data1 in an array2  Data2 in an array"
46string(20) "text text text text "
47string(20) "text text text text "
48--- Done ---
49