github kjdev/php-ext-brotli 0.21.0

3 hours ago

[0.21.0] - 2026-08-13

✨ Added

  • Built-in MIME type exclusion list (#98, 416ee17, #100, f761b4b)
    • The extension now ships a built-in list of non-compressible MIME types (video/, audio/, common image/font/archive formats), consulted whenever brotli.output_compression_exclude_types doesn't produce a definitive match
    • The list is shown in the phpinfo() output
    • Regression tests tests/ob_exclude_004.phpt (wildcard match) and renamed tests/ob_exclude_001.phpt to reflect it exercises the built-in list without any ini setting
  • Negation tokens in brotli.output_compression_exclude_types (#102)
    • A token prefixed with ! re-enables compression for a MIME type that would otherwise be excluded by the built-in list, supporting exact matches and type/* wildcards
    • Within the same list, when multiple tokens match a MIME type, the last one wins regardless of sign (gitignore-style precedence), e.g. image/*,!image/png excludes all images except PNG
    • Regression tests tests/ob_exclude_005.phpttests/ob_exclude_008.phpt
  • phpinfo() improvements (#99)
    • Show whether the bundled or an external Brotli library is in use
    • Show whether the brotli APCu serializer is active, inactive, or APCu isn't loaded
    • Rename "APCu serializer ABI" to "APCu serializer interface version", and show when APCu support wasn't built in

🐛 Fixed

  • Memory leak when BrotliEncoderCompressStream() fails on PHP 7.4+ (#95, b222289)
    • The early-return path taken on PHP_VERSION_ID >= 70400 didn't free output, unlike the other path
  • Compiler warnings (#96, 1618491, dc4e1e5)
    • Silence a -Wunicode warning from an unintended \U escape sequence
    • Remove unused zval *res locals in brotli_compress_add() and brotli_uncompress_add()

📈 Improved

  • Deflake tests/streams_001.phpt, tests/streams_002.phpt and tests/streams_004.phpt by giving each its own scratch file instead of sharing tests/data.out (#101, 5d988e7)
    • PHP 8.6's parallel run-tests.php workers raced each other over the shared file, causing intermittent failures

What's Changed

Full Changelog: 0.20.0...0.21.0

Don't miss a new php-ext-brotli release

NewReleases is sending notifications on new releases.