014.phpt 659 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Phar::mapPhar filesize mismatch
  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. // wrong crc32
  13. $files = array();
  14. $files['a'] = array('cont'=>'a', 'crc32'=>crc32('aX'));
  15. include 'files/phar_test.inc';
  16. echo file_get_contents($pname.'/a');
  17. ?>
  18. --CLEAN--
  19. <?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
  20. --EXPECTF--
  21. Warning: file_get_contents(phar://%s/a): Failed to open stream: phar error: internal corruption of phar "%s" (crc32 mismatch on file "a") in %s on line %d