diff options
author | SVN Migration <svn@php.net> | 2008-05-12 21:03:49 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2008-05-12 21:03:49 +0000 |
commit | 16b4d8e0e1108564fa042520171d9091af708d83 (patch) | |
tree | ed242b98e845ea9c045ad6e10b9e9a083b569dd5 /ext/phar/tests/phar_oo_compressed_002b.phpt | |
parent | e35c45791383ac9337adcd37255895f396001557 (diff) | |
download | php-git-16b4d8e0e1108564fa042520171d9091af708d83.tar.gz |
This commit was manufactured by cvs2svn to create branch 'PHP_5_3'.
Diffstat (limited to 'ext/phar/tests/phar_oo_compressed_002b.phpt')
-rwxr-xr-x | ext/phar/tests/phar_oo_compressed_002b.phpt | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/ext/phar/tests/phar_oo_compressed_002b.phpt b/ext/phar/tests/phar_oo_compressed_002b.phpt new file mode 100755 index 0000000000..0e167012b7 --- /dev/null +++ b/ext/phar/tests/phar_oo_compressed_002b.phpt @@ -0,0 +1,73 @@ +--TEST-- +Phar: context/compress=BZip2 +--SKIPIF-- +<?php if (!extension_loaded("phar")) die("skip"); ?> +<?php if (!extension_loaded("bz2")) die("skip bz2 not present"); ?> +--INI-- +phar.readonly=0 +phar.require_hash=0 +--FILE-- +<?php +$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; +$pname = 'phar://' . $fname; +$file = '<?php __HALT_COMPILER(); ?>'; + +$files = array(); +$files['a'] = 'a'; +$files['b'] = 'b'; +$files['c'] = 'c'; + +include 'files/phar_test.inc'; + +$phar = new Phar($fname); + +var_dump(file_get_contents($pname . '/a')); +var_dump($phar['a']->isCompressed()); +var_dump(file_get_contents($pname . '/b')); +var_dump($phar['b']->isCompressed()); +var_dump(file_get_contents($pname . '/c')); +var_dump($phar['c']->isCompressed()); + +$context = stream_context_create(array('phar'=>array('compress'=>Phar::BZ2))); + +file_put_contents($pname . '/b', 'new b'); +file_put_contents($pname . '/c', 'new c', 0, $context); +file_put_contents($pname . '/d', 'new d'); +file_put_contents($pname . '/e', 'new e', 0, $context); + +$phar = new Phar($fname); +var_dump(file_get_contents($pname . '/a')); +var_dump($phar['a']->isCompressed()); +var_dump(file_get_contents($pname . '/b')); +var_dump($phar['b']->isCompressed()); +var_dump(file_get_contents($pname . '/c')); +var_dump($phar['c']->isCompressed()); +var_dump(file_get_contents($pname . '/d')); +var_dump($phar['d']->isCompressed()); +var_dump(file_get_contents($pname . '/e')); +var_dump($phar['e']->isCompressed()); + +?> +===DONE=== +--CLEAN-- +<?php +unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); +?> +--EXPECTF-- +string(1) "a" +bool(false) +string(1) "b" +bool(false) +string(1) "c" +bool(false) +string(1) "a" +bool(false) +string(5) "new b" +bool(false) +string(5) "new c" +bool(true) +string(5) "new d" +bool(false) +string(5) "new e" +bool(true) +===DONE=== |