2009-01-19 14:03:19 +00:00
|
|
|
--TEST--
|
|
|
|
Test function gzfile() reading a plain relative file
|
2021-06-11 09:57:42 +00:00
|
|
|
--EXTENSIONS--
|
|
|
|
zlib
|
2009-01-19 14:03:19 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2016-11-06 21:28:42 +00:00
|
|
|
$plaintxt = <<<EOT
|
2009-01-19 14:03:19 +00:00
|
|
|
hello world
|
|
|
|
is a very common test
|
|
|
|
for all languages
|
|
|
|
EOT;
|
2024-07-05 23:59:01 +00:00
|
|
|
$dirname = 'gzfile_temp2';
|
2013-09-26 07:18:05 +00:00
|
|
|
$filename = $dirname.'/gzfile_basic2.txt';
|
2009-01-19 14:03:19 +00:00
|
|
|
mkdir($dirname);
|
|
|
|
$h = fopen($filename, 'w');
|
|
|
|
fwrite($h, $plaintxt);
|
|
|
|
fclose($h);
|
|
|
|
|
|
|
|
|
|
|
|
var_dump(gzfile( $filename ) );
|
|
|
|
|
|
|
|
unlink($filename);
|
|
|
|
rmdir($dirname);
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
array(3) {
|
|
|
|
[0]=>
|
|
|
|
string(12) "hello world
|
|
|
|
"
|
|
|
|
[1]=>
|
|
|
|
string(22) "is a very common test
|
|
|
|
"
|
|
|
|
[2]=>
|
|
|
|
string(17) "for all languages"
|
|
|
|
}
|