Annotation of embedaddon/php/ext/phar/tests/tar/tar_gzipU.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: tar-based phar, gzipped tar
3: --SKIPIF--
4: <?php
5: if (!extension_loaded("phar")) die("skip");
6: if (version_compare(PHP_VERSION, "6.0", "<")) die("skip Unicode support required");
7: if (!extension_loaded("spl")) die("skip SPL not available");
8: if (!extension_loaded("zlib")) die("skip zlib not available");
9: if (version_compare(phpversion(), '5.2.6', '<')) die("skip zlib is buggy in PHP < 5.2.6");
10: ?>
11: --INI--
12: phar.readonly=0
13: phar.require_hash=0
14: --FILE--
15: <?php
16: include dirname(__FILE__) . '/files/tarmaker.php.inc';
17: $fname = dirname(__FILE__) . '/tar_gzip.phar';
18: $pname = 'phar://' . $fname;
19: $fname2 = dirname(__FILE__) . '/tar_gzip.phar.tar';
20: $pname2 = 'phar://' . $fname2;
21:
22: $a = new tarmaker($fname, 'zlib');
23: $a->init();
24: $a->addFile('tar_004.php', '<?php var_dump(__FILE__);');
25: $a->addFile('internal/file/here', "hi there!\n");
26: $a->mkDir('internal/dir');
27: $a->mkDir('dir');
28: $a->addFile('.phar/stub.php', '<?php
29: Phar::mapPhar();
30: var_dump("it worked");
31: include "phar://" . __FILE__ . "/tar_004.php";
32: ');
33: $a->close();
34:
35: include $fname;
36:
37: $a = new Phar($fname);
38: $a['test'] = 'hi';
39: copy($fname, $fname2);
40: $b = new Phar($fname2);
41: var_dump($b->isFileFormat(Phar::TAR));
42: var_dump($b->isCompressed() == Phar::GZ);
43: ?>
44: ===DONE===
45: --CLEAN--
46: <?php
47: @unlink(dirname(__FILE__) . '/tar_gzip.phar');
48: @unlink(dirname(__FILE__) . '/tar_gzip.phar.tar');
49: ?>
50: --EXPECTF--
51: unicode(9) "it worked"
52: unicode(%d) "phar://%star_gzip.phar/tar_004.php"
53: bool(true)
54: bool(true)
55: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>