1--TEST--
2Phar object: getContent() (verify it works with compression)
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5<?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
6<?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
7--INI--
8phar.readonly=0
9--FILE--
10<?php
11$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
12$fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.php';
13
14$phar = new Phar($fname);
15$phar['a'] = 'file contents
16this works';
17$phar['a']->compress(Phar::GZ);
18copy($fname, $fname2);
19$phar2 = new Phar($fname2);
20var_dump($phar2['a']->isCompressed());
21echo $phar2['a']->getContent() . "\n";
22?>
23===DONE===
24--CLEAN--
25<?php
26unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
27unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.2.phar.php');
28__halt_compiler();
29?>
30--EXPECT--
31bool(true)
32file contents
33this works
34===DONE===
35