Annotation of embedaddon/php/ext/phar/tests/phar_create_in_cwd.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: attempt to create a Phar with relative path
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.require_hash=0
7: phar.readonly=0
8: --FILE--
9: <?php
10: chdir(dirname(__FILE__));
11: try {
12: $p = new Phar('brandnewphar.phar');
13: $p['file1.txt'] = 'hi';
14: var_dump(strlen($p->getStub()));
15: $p->setStub("<?php
16: function __autoload(\$class)
17: {
18: include 'phar://' . str_replace('_', '/', \$class);
19: }
20: Phar::mapPhar('brandnewphar.phar');
21: include 'phar://brandnewphar.phar/startup.php';
22: __HALT_COMPILER();
23: ?>");
24: var_dump($p->getStub());
25: } catch (Exception $e) {
26: echo $e->getMessage() . "\n";
27: }
28: ?>
29: ===DONE===
30: --CLEAN--
31: <?php
32: unlink(dirname(__FILE__) . '/brandnewphar.phar');
33: ?>
34: --EXPECT--
35: int(6683)
36: string(200) "<?php
37: function __autoload($class)
38: {
39: include 'phar://' . str_replace('_', '/', $class);
40: }
41: Phar::mapPhar('brandnewphar.phar');
42: include 'phar://brandnewphar.phar/startup.php';
43: __HALT_COMPILER(); ?>
44: "
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>