Annotation of embedaddon/php/ext/phar/tests/030.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Phar::loadPhar ignoring alias
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("phar")) die("skip"); ?>
                      5: --INI--
                      6: phar.require_hash=0
                      7: --FILE--
                      8: <?php
                      9: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
                     10: $pname = 'phar://' . $fname;
                     11: $file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
                     12: 
                     13: $files = array();
                     14: $files['a.php']   = '<?php echo "This is a\n"; include \''.$pname.'/b.php\'; ?>';
                     15: $files['b.php']   = '<?php echo "This is b\n"; include \''.$pname.'/b/c.php\'; ?>';
                     16: $files['b/c.php'] = '<?php echo "This is b/c\n"; include \''.$pname.'/b/d.php\'; ?>';
                     17: $files['b/d.php'] = '<?php echo "This is b/d\n"; include \''.$pname.'/e.php\'; ?>';
                     18: $files['e.php']   = '<?php echo "This is e\n"; ?>';
                     19: $files['.phar/test'] = '<?php bad boy ?>';
                     20: 
                     21: include 'files/phar_test.inc';
                     22: 
                     23: Phar::loadPhar($fname);
                     24: 
                     25: require $pname . '/a.php';
                     26: 
                     27: $p = new Phar($fname);
                     28: var_dump(isset($p['.phar/test']));
                     29: try {
                     30: $p['.phar/test'];
                     31: } catch (Exception $e) {
                     32: echo $e->getMessage(),"\n";
                     33: }
                     34: ?>
                     35: ===DONE===
                     36: --CLEAN--
                     37: <?php 
                     38: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
                     39: ?>
                     40: --EXPECTF--
                     41: This is a
                     42: This is b
                     43: This is b/c
                     44: This is b/d
                     45: This is e
                     46: bool(false)
                     47: Cannot directly get any files or directories in magic ".phar" directory
                     48: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>