023.phpt 825 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Phar: phar:// file_get_contents
  3. --EXTENSIONS--
  4. phar
  5. --INI--
  6. phar.require_hash=0
  7. --FILE--
  8. <?php
  9. $fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
  10. $pname = 'phar://' . $fname;
  11. $file = "<?php __HALT_COMPILER(); ?>";
  12. $files = array();
  13. $files['a.php'] = '<?php echo "This is a\n"; ?>';
  14. $files['b.php'] = '<?php echo "This is b\n"; ?>';
  15. $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
  16. include 'files/phar_test.inc';
  17. var_dump(file_get_contents($pname . '/a.php'));
  18. var_dump(file_get_contents($pname . '/b.php'));
  19. var_dump(file_get_contents($pname . '/b/c.php'));
  20. ?>
  21. --CLEAN--
  22. <?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
  23. --EXPECT--
  24. string(28) "<?php echo "This is a\n"; ?>"
  25. string(28) "<?php echo "This is b\n"; ?>"
  26. string(30) "<?php echo "This is b/c\n"; ?>"