2009-12-09 13:25:10 +00:00
|
|
|
--TEST--
|
|
|
|
Test gzencode() function : variation
|
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if( substr(PHP_OS, 0, 3) != "WIN" ) {
|
|
|
|
die("skip only for Windows");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!extension_loaded("zlib")) {
|
|
|
|
print "skip - ZLIB extension not loaded";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
/* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] )
|
|
|
|
* Description: Gzip-compress a string
|
|
|
|
* Source code: ext/zlib/zlib.c
|
|
|
|
* Alias to functions:
|
|
|
|
*/
|
|
|
|
|
2012-04-16 12:04:29 +00:00
|
|
|
if(!function_exists("gzdecode")) {
|
|
|
|
function gzdecode($data)
|
|
|
|
{
|
|
|
|
return gzinflate(substr($data,10,-8));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-09 13:25:10 +00:00
|
|
|
include(dirname(__FILE__) . '/data.inc');
|
|
|
|
|
|
|
|
echo "*** Testing gzencode() : variation ***\n";
|
|
|
|
|
|
|
|
echo "\n-- Testing multiple compression --\n";
|
2012-04-16 12:04:29 +00:00
|
|
|
$output = gzencode(gzencode($data));
|
2009-12-09 13:25:10 +00:00
|
|
|
|
2012-04-16 12:04:29 +00:00
|
|
|
$back = gzdecode(gzdecode($output));
|
|
|
|
var_dump($data === $back);
|
2009-12-09 13:25:10 +00:00
|
|
|
?>
|
|
|
|
===Done===
|
|
|
|
--EXPECT--
|
|
|
|
*** Testing gzencode() : variation ***
|
|
|
|
|
|
|
|
-- Testing multiple compression --
|
2012-04-16 12:04:29 +00:00
|
|
|
bool(true)
|
2009-12-09 13:25:10 +00:00
|
|
|
===Done===
|