File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ --TEST--
2+ zstd_uncompress_dict(): streaming compress
3+ --SKIPIF--
4+ <?php
5+ if (LIBZSTD_VERSION_NUMBER < 10304 ) die ("skip needs libzstd 1.3.4 " );
6+ ?>
7+ --FILE--
8+ <?php
9+ include (dirname (__FILE__ ) . '/data.inc ' );
10+ $ dictionary = file_get_contents (dirname (__FILE__ ) . '/data.dic ' );
11+
12+ $ context = stream_context_create (
13+ array (
14+ 'zstd ' => array (
15+ 'dict ' => $ dictionary ,
16+ )
17+ )
18+ );
19+
20+ $ file = dirname (__FILE__ ) . '/data_ ' . basename (__FILE__ , ".php " ) . '.out ' ;
21+ file_put_contents ('compress.zstd:// ' . $ file , $ data , context: $ context );
22+ $ enc = file_get_contents ($ file );
23+
24+ $ dec = zstd_uncompress_dict ($ enc , $ dictionary );
25+
26+ var_dump ($ data === $ dec );
27+
28+ @unlink ($ file );
29+ ?>
30+ ===Done===
31+ --EXPECTF--
32+ bool(true)
33+ ===Done===
You can’t perform that action at this time.
0 commit comments