mirror of
https://github.com/php-win-ext/php-rar.git
synced 2026-04-24 21:08:07 +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
58 lines
1.6 KiB
PHP
58 lines
1.6 KiB
PHP
--TEST--
|
|
Directory streams compatibility with RecursiveDirectoryIterator
|
|
--SKIPIF--
|
|
<?php
|
|
if(!extension_loaded("rar")) die("skip");
|
|
--FILE--
|
|
<?php
|
|
|
|
$a = "rar://" . dirname(__FILE__) . '/dirs_and_extra_headers.rar#';
|
|
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($a),
|
|
RecursiveIteratorIterator::LEAVES_ONLY);
|
|
|
|
$it->rewind();
|
|
while($it->valid()) {
|
|
if (!$it->isDot()) {
|
|
echo 'SubPathName: ' . rawurldecode($it->getSubPathName()) . "\n";
|
|
echo 'SubPath: ' . rawurldecode($it->getSubPath()) . "\n";
|
|
echo 'Key: ' . $it->key() . "\n\n";
|
|
}
|
|
$it->next();
|
|
}
|
|
|
|
echo "Done.\n";
|
|
--EXPECTF--
|
|
SubPathName: file1.txt
|
|
SubPath:
|
|
Key: rar://%s/dirs_and_extra_headers.rar#%sfile1.txt
|
|
|
|
SubPathName: file2_אּ.txt
|
|
SubPath:
|
|
Key: rar://%s/dirs_and_extra_headers.rar#%sfile2_%EF%AC%B0.txt
|
|
|
|
SubPathName: with_streams.txt
|
|
SubPath:
|
|
Key: rar://%s/dirs_and_extra_headers.rar#%swith_streams.txt
|
|
|
|
SubPathName: אּ%s%2Fempty%2E%sfile7.txt
|
|
SubPath: אּ%s%2Fempty%2E
|
|
Key: rar://%s/dirs_and_extra_headers.rar#%s%EF%AC%B0%s%252Fempty%252E%sfile7.txt
|
|
|
|
SubPathName: אּ%sfile3.txt
|
|
SubPath: אּ
|
|
Key: rar://%s/dirs_and_extra_headers.rar#%s%EF%AC%B0%sfile3.txt
|
|
|
|
SubPathName: אּ%sfile4_אּ.txt
|
|
SubPath: אּ
|
|
Key: rar://%s/dirs_and_extra_headers.rar#%s%EF%AC%B0%sfile4_%EF%AC%B0.txt
|
|
|
|
SubPathName: אּ%sאּ_2%sfile5.txt
|
|
SubPath: אּ%sאּ_2
|
|
Key: rar://%s/dirs_and_extra_headers.rar#%s%EF%AC%B0%s%EF%AC%B0_2%sfile5.txt
|
|
|
|
SubPathName: אּ%sאּ_2%sfile6_אּ.txt
|
|
SubPath: אּ%sאּ_2
|
|
Key: rar://%s/dirs_and_extra_headers.rar#%s%EF%AC%B0%s%EF%AC%B0_2%sfile6_%EF%AC%B0.txt
|
|
|
|
Done.
|