Skip to content

Commit f9289ba

Browse files
committed
Updated version to 0.6.0
1 parent fba49cf commit f9289ba

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,29 @@ brotli.ini:
3838
extension=brotli.so
3939
```
4040

41+
### Experimental output handler option
42+
43+
Name | Default | Changeable
44+
--------------------------------- | ------- | ----------
45+
brotli.output\_compression | 0 | PHP\_INI\_ALL
46+
brotli.output\_compression\_level | -1 | PHP\_INI\_ALL
47+
48+
* brotli.output\_compression _boolean_
49+
50+
Whether to transparently compress pages.
51+
If this option is set to "On" in php.ini or the Apache configuration,
52+
pages are compressed if the browser sends an "Accept-Encoding: br" header.
53+
"Content-Encoding: br" and "Vary: Accept-Encoding" headers are added to
54+
the output. In runtime, it can be set only before sending any output.
55+
56+
* brotli.output\_compression\_level _integer_
57+
58+
Compression level used for transparent output compression.
59+
Specify a value between 0 to 11.
60+
The default value of -1 uses internally defined values (11).
61+
62+
> Available since PHP 5.4.0.
63+
4164
## Function
4265

4366
* brotli\_compress — Compress a string
@@ -102,3 +125,15 @@ $uncompressed = brotli_uncompress($compressed);
102125
103126
echo $uncompressed;
104127
```
128+
129+
### Output handler
130+
131+
```
132+
ini_set('brotli.output_compression', 'On');
133+
// OR
134+
// ob_start('ob_brotli_handler');
135+
136+
echo ...;
137+
```
138+
139+
> "Accept-Encoding: br" must be specified.

php_brotli.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
extern "C" {
66
#endif
77

8-
#define BROTLI_EXT_VERSION "0.5.2"
8+
#define BROTLI_EXT_VERSION "0.6.0"
99

1010
extern zend_module_entry brotli_module_entry;
1111
#define phpext_brotli_ptr &brotli_module_entry

0 commit comments

Comments
 (0)