mirror of
https://github.com/php-win-ext/php-rar.git
synced 2026-03-26 05:52:06 +01:00
- Fixed handling of archives with no entries. - Removed trailing full stops from some error messages. - Substituted zend_error for php_error_docref. - Fixed inconsistent behavior of EOF for streams (reading at file boundaries would could set EOF or not). git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@299945 c90b9560-bf6c-de11-be94-00142212c4b1
31 lines
699 B
PHP
31 lines
699 B
PHP
--TEST--
|
|
rar_close() liberates resource (PECL bug #9649)
|
|
--SKIPIF--
|
|
<?php if(!extension_loaded("rar")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
copy(dirname(__FILE__).'/latest_winrar.rar', dirname(__FILE__).'/temp.rar');
|
|
$rar_file1 = rar_open(dirname(__FILE__).'/temp.rar');
|
|
echo $rar_file1."\n";
|
|
$entries = rar_list($rar_file1);
|
|
$entry1 = reset($entries);
|
|
unset($entries);
|
|
echo $entry1."\n";
|
|
echo "\n";
|
|
|
|
rar_close($rar_file1);
|
|
echo $rar_file1."\n";
|
|
$entry1->extract(".");
|
|
unlink(dirname(__FILE__).'/temp.rar');
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
RAR Archive "%s"
|
|
RarEntry for file "1.txt" (a0de71c0)
|
|
|
|
RAR Archive "%s" (closed)
|
|
|
|
Warning: RarEntry::extract(): The archive is already closed in %s on line %d
|
|
Done
|