1--TEST-- 2Phar: bzipped phar 3--SKIPIF-- 4<?php 5if (!extension_loaded("phar")) die("skip"); 6if (!extension_loaded("bz2")) die("skip bz2 not available"); 7?> 8--INI-- 9phar.readonly=0 10phar.require_hash=0 11--FILE-- 12<?php 13$fname = __DIR__ . '/phar_bz2.phar'; 14$pname = 'phar://' . $fname; 15$fname2 = __DIR__ . '/phar_bz2.2.phar'; 16$pname2 = 'phar://' . $fname2; 17 18$file = '<?php 19Phar::mapPhar(); 20var_dump("it worked"); 21include "phar://" . __FILE__ . "/tar_004.php"; 22__HALT_COMPILER();'; 23 24$files = array(); 25$files['tar_004.php'] = '<?php var_dump(__FILE__);'; 26$files['internal/file/here'] = "hi there!\n"; 27$files['internal/dir/'] = ''; 28$files['dir/'] = ''; 29$bz2 = true; 30 31include 'files/phar_test.inc'; 32 33include $fname; 34 35$a = new Phar($fname); 36$a['test'] = 'hi'; 37copy($fname, $fname2); 38$a->setAlias('another'); 39$b = new Phar($fname2); 40var_dump($b->isFileFormat(Phar::PHAR)); 41var_dump($b->isCompressed() == Phar::BZ2); 42// additional code coverage 43try { 44$b->isFileFormat(25); 45} catch (Exception $e) { 46echo $e->getMessage(),"\n"; 47} 48?> 49--CLEAN-- 50<?php 51@unlink(__DIR__ . '/phar_bz2.phar'); 52@unlink(__DIR__ . '/phar_bz2.2.phar'); 53?> 54--EXPECTF-- 55string(9) "it worked" 56string(%d) "phar://%sphar_bz2.phar/tar_004.php" 57bool(true) 58bool(true) 59Unknown file format specified 60