Add support for brotli (#1000)

pull/1002/head
Michele Locati 2024-11-06 10:26:43 +01:00 committed by GitHub
parent 776706bc34
commit 1bfe32ae86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View File

@ -5,6 +5,7 @@ ast 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
bcmath 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
bitset 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
blackfire 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
brotli 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
bz2 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
calendar 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
cassandra 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4

22
scripts/tests/brotli Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env php
<?php
foreach ([
'brotli_compress',
'brotli_uncompress',
] as $function) {
if (!function_exists($function)) {
fwrite(STDERR, "Missing function: {$function}\n");
exit(1);
}
}
$data = 'This is some data to be compressed';
$compressed = brotli_compress($data, BROTLI_COMPRESS_LEVEL_MAX, BROTLI_TEXT);
$uncompressed = brotli_uncompress($compressed);
if ($uncompressed !== $data) {
fwrite(STDERR, "brotli_compress() -> brotli_uncompress() failure!\n");
exit(1);
}
echo "brotli_compress() -> brotli_uncompress() works\n";
return 0;