1--TEST-- 2Phar::compressFiles(Phar::BZ2) 3--EXTENSIONS-- 4phar 5bz2 6--INI-- 7phar.require_hash=0 8phar.readonly=0 9--FILE-- 10<?php 11$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php'; 12$pname = 'phar://' . $fname; 13$file = '<?php __HALT_COMPILER(); ?>'; 14 15$files = array(); 16$files['a'] = 'a'; 17$files['b'] = 'b'; 18$files['c'] = 'c'; 19 20include 'files/phar_test.inc'; 21 22$phar = new Phar($fname); 23 24var_dump(file_get_contents($pname . '/a')); 25var_dump($phar['a']->isCompressed()); 26var_dump(file_get_contents($pname . '/b')); 27var_dump($phar['b']->isCompressed()); 28var_dump(file_get_contents($pname . '/c')); 29var_dump($phar['c']->isCompressed()); 30 31$phar = new Phar($fname); 32$phar->compressFiles(Phar::BZ2); 33var_dump(file_get_contents($pname . '/a')); 34var_dump($phar['a']->isCompressed(Phar::GZ)); 35var_dump($phar['a']->isCompressed(Phar::BZ2)); 36var_dump(file_get_contents($pname . '/b')); 37var_dump($phar['b']->isCompressed(Phar::GZ)); 38var_dump($phar['b']->isCompressed(Phar::BZ2)); 39var_dump(file_get_contents($pname . '/c')); 40var_dump($phar['c']->isCompressed(Phar::GZ)); 41var_dump($phar['b']->isCompressed(Phar::BZ2)); 42 43?> 44--CLEAN-- 45<?php 46unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); 47?> 48--EXPECT-- 49string(1) "a" 50bool(false) 51string(1) "b" 52bool(false) 53string(1) "c" 54bool(false) 55string(1) "a" 56bool(false) 57bool(true) 58string(1) "b" 59bool(false) 60bool(true) 61string(1) "c" 62bool(false) 63bool(true) 64