2005-12-11 00:00:31 +00:00
|
|
|
--TEST--
|
2006-01-01 23:05:42 +00:00
|
|
|
Phar::mapPhar invalid file (gzipped file length is too short)
|
2005-12-11 00:00:31 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("phar")) print "skip";
|
|
|
|
if (!PHP_Archive::canCompress()) print "skip"; ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$file = "<?php
|
2006-01-01 22:58:12 +00:00
|
|
|
Phar::mapPhar('hio', true);
|
2005-12-11 00:00:31 +00:00
|
|
|
__HALT_COMPILER(); ?>";
|
|
|
|
// file length is too short
|
|
|
|
$manifest = pack('V', 1) . 'a' . pack('VVVV', 1, time(), 0, 9);
|
2006-01-01 22:10:21 +00:00
|
|
|
$file .= pack('VV', strlen($manifest) + 4, 1) . $manifest . pack('VV', crc32('a'), 1) . chr(0) . chr(4) . chr(0); // 'a' gzdeflated
|
2006-01-04 16:43:42 +00:00
|
|
|
file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
|
|
|
|
include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
|
2005-12-11 00:00:31 +00:00
|
|
|
echo file_get_contents('phar://hio/a');
|
|
|
|
?>
|
2006-01-04 16:43:42 +00:00
|
|
|
--CLEAN--
|
|
|
|
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
|
2005-12-11 00:00:31 +00:00
|
|
|
--EXPECTF--
|
2005-12-12 06:17:16 +00:00
|
|
|
Warning: file_get_contents(phar://hio/a): failed to open stream: phar error: decompression failed in %s on line %d
|