mirror of
https://github.com/php-win-ext/php-rar.git
synced 2026-04-24 04:48:05 +02:00
9a7227a9e0
- RAR navigation and indexing were moved to rar_navigation.c. - RAR archives that contain entries with the same name are correctly handled. - Changed the way properties are accessed in RarEntry (does not require building the properties table in trunk). - Fixed memory leak in silent url stat. - Fixed handling of optional passwords. Now giving no password, NULL or '' result in the same behavior. git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@299926 c90b9560-bf6c-de11-be94-00142212c4b1
34 lines
695 B
PHP
34 lines
695 B
PHP
--TEST--
|
|
RarEntry::extract handles files with non-unique entry names
|
|
--SKIPIF--
|
|
<?php if(!extension_loaded("rar")) print "skip"; ?>
|
|
--CLEAN--
|
|
<?php
|
|
$dest = dirname(__FILE__) . "temp_file";
|
|
@unlink($dest);
|
|
--FILE--
|
|
<?php
|
|
|
|
$file = RarArchive::open(dirname(__FILE__) . '/repeated_name.rar');
|
|
$dest = dirname(__FILE__) . "temp_file";
|
|
|
|
foreach ($file as $e) {
|
|
$res = $e->extract("", $dest);
|
|
if ($res) {
|
|
echo $e->getPosition() . ". $e\n";
|
|
echo file_get_contents($dest);
|
|
echo "\n";
|
|
}
|
|
else {
|
|
die("failed extraction");
|
|
}
|
|
}
|
|
|
|
echo "Done.\n";
|
|
--EXPECTF--
|
|
0. RarEntry for file "file.txt" (ae2a88a7)
|
|
Content of first file.
|
|
1. RarEntry for file "file.txt" (771df243)
|
|
Content of second file.
|
|
Done.
|