Files
php-rar/tests/072.phpt
cataphract 9a7227a9e0 - Storage of the entries and its navigation were reformulated. The previous array with raw entries was substituted with an array with unique entries that also stores the directory depth and length of the entry name. The hash table used for direct access (url stater mainly) was substituted for a sorted array that makes directory navigation more efficient. The penalty of losing constant time access to entries by name (now it takes log n) was mitigated by a cache that is optimized for stating every element while a directory or the whole file are being traversed.
- 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
2010-05-29 02:28:23 +00:00

22 lines
434 B
PHP

--TEST--
rar_list handles files with non-unique entry names
--SKIPIF--
<?php if(!extension_loaded("rar")) print "skip"; ?>
--FILE--
<?php
$file = RarArchive::open(dirname(__FILE__) . '/repeated_name.rar');
$entries = rar_list($file);
foreach ($entries as $e) {
echo $e->getPosition() . ". $e\n";
}
echo "\n";
echo "Done.\n";
--EXPECTF--
0. RarEntry for file "file.txt" (ae2a88a7)
1. RarEntry for file "file.txt" (771df243)
Done.