011.phpt 789 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Phar::mapPhar filesize too small in manifest
  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
  12. Phar::mapPhar('hio');
  13. __HALT_COMPILER(); ?>";
  14. // compressed file length does not match incompressed length for an uncompressed file
  15. $files = array();
  16. $files['a'] = array('cont'=>'a','ulen'=>1,'clen'=>2);
  17. include 'files/phar_test.inc';
  18. try {
  19. include $fname;
  20. echo file_get_contents('phar://hio/a');
  21. } catch (Exception $e) {
  22. echo $e->getMessage();
  23. }
  24. ?>
  25. --CLEAN--
  26. <?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
  27. --EXPECTF--
  28. internal corruption of phar "%s" (compressed and uncompressed size does not match for uncompressed entry)