78 Commits

Author SHA1 Message Date
Gustavo Lopes
b3145c9883 Fix stat times not being in UTC
They depended on the system timezone, because the unrar lib returns them
in the local time.
2017-07-21 18:41:06 +01:00
Gustavo Lopes
5a9886a844 Windows support and appveyor 2017-07-21 18:41:06 +01:00
Gustavo Lopes
bdd4ce2357 Add redirection functions to RarEntry 2017-07-21 18:41:06 +01:00
Gustavo Lopes
2fd19b59ca Fix cloning of RarArchive being allowed 2017-07-21 18:41:06 +01:00
Gustavo Lopes
83756881c2 Rework to support 7.0 and 7.1 2017-07-21 18:40:58 +01:00
Gustavo Lopes
1a2f9f5104 Fix tests/101.phpt 2017-07-18 03:55:44 +01:00
Gustavo Lopes
119722d581 Merge branch 'unrar', with unrar 5.5.6 2017-07-17 17:09:44 +01:00
Gustavo Lopes
2ab141deed Add test for RAR5 archive 2017-07-17 15:13:11 +01:00
Gustavo Lopes
65d5132550 Merge branch 'unrar'
Conflicts:
	unrar/UnRAR.vcproj
	unrar/UnRARDll.vcproj
	unrar/arccmt.cpp
	unrar/arcread.cpp
	unrar/cmddata.cpp
	unrar/dll.cpp
	unrar/dll.hpp
	unrar/dll.rc
	unrar/errhnd.hpp
	unrar/extract.cpp
	unrar/extract.hpp
	unrar/filefn.cpp
	unrar/headers.hpp
	unrar/makefile
	unrar/os.hpp
	unrar/rdwrfn.hpp
	unrar/unpack.cpp
	unrar/unpack.hpp
	unrar/unpack15.cpp
	unrar/version.hpp
	unrar/volume.cpp
2017-07-17 06:30:09 +01:00
Gustavo Lopes
881989bbac Allow 'rb' mode for opening rar entries 2013-04-28 21:13:34 +02:00
Gustavo Lopes
0a57b9b313 Remove revision information 2012-07-29 02:02:35 +00:00
Gustavo Lopes
3b9dd4dd6e Added test for bug #59939 (can't reproduce) 2012-07-29 00:44:38 +00:00
Gustavo Lopes
21cba90843 Fix some tests for when TZ != 'Europe/Lisbon' 2012-07-29 00:28:32 +00:00
cataphract
eca703e481 Preparing for 3.0.0 release
git-svn-id: https://svn.php.net/repository/pecl/rar/trunk@312082 c90b9560-bf6c-de11-be94-00142212c4b1
2011-06-12 04:59:29 +01:00
cataphract
47ff0254ea Fixed tests.
git-svn-id: https://svn.php.net/repository/pecl/rar/trunk@312078 c90b9560-bf6c-de11-be94-00142212c4b1
2011-06-12 03:24:53 +01:00
cataphract
b92bcc5d5f - Fixed a build failure on gcc.
- Changed // comments into /* ones on C portions.
- Simplified the output of some stat tests.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@306221 c90b9560-bf6c-de11-be94-00142212c4b1
2010-12-11 05:56:20 +00:00
cataphract
da39115344 - Merge with RAR 4.0.2
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@306117 c90b9560-bf6c-de11-be94-00142212c4b1
2010-12-09 07:54:59 +00:00
cataphract
5947ee8db4 - Fixed PECL bug #18449 (Extraction of uncompressed and encrypted files fails).
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@306110 c90b9560-bf6c-de11-be94-00142212c4b1
2010-12-09 05:13:01 +00:00
cataphract
9cd2943b79 - I give up.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@300146 c90b9560-bf6c-de11-be94-00142212c4b1
2010-06-03 04:47:07 +00:00
cataphract
d9ccfe265f - Fixed actual revision of test file being in the test file (or
something).


git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@300145 c90b9560-bf6c-de11-be94-00142212c4b1
2010-06-03 04:46:04 +00:00
cataphract
a6b4c57b1c - Added module info test.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@300143 c90b9560-bf6c-de11-be94-00142212c4b1
2010-06-03 04:34:00 +00:00
cataphract
535f0ea828 - Added test for wrapper cache eviction (required adding the function rar_wraper_cache_stats).
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@300141 c90b9560-bf6c-de11-be94-00142212c4b1
2010-06-03 04:17:48 +00:00
cataphract
5d1aafd746 - Oops forgot to commit the tests
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@300084 c90b9560-bf6c-de11-be94-00142212c4b1
2010-06-02 03:51:46 +00:00
cataphract
9d49ce4842 - Omitted volume not found warning if volume callback was specified.
. rar_broken_is omits no warnings (except the volume not found one, but see above)
- Tests for reading broken files
- Other tests for rararch.c

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@300083 c90b9560-bf6c-de11-be94-00142212c4b1
2010-06-02 03:20:10 +00:00
cataphract
1e97aa1ef1 - Added unset_dimension handler.
- Added remaining tests for the dimension handlers.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@300016 c90b9560-bf6c-de11-be94-00142212c4b1
2010-06-01 01:15:07 +00:00
cataphract
929b252665 - Fixed bug in dimensions handler.
- Added tests for read_dimensions handler.
- Methods/functions that receive no parameters enforce that.
- Added rar_is_broken and rar_allow_broken_set.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@300009 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-31 20:05:42 +00:00
cataphract
7bfe225895 - Implemented dimensions handlers.
- foreach no longer works for incomplete archives (will be possible again in the future via a new method in RarArchive).
- On incomplete archives, rar_list and rar_entry_get always fail instead of failing the first time and being successful subsequently.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@299970 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-31 04:10:39 +00:00
cataphract
dff57d32cb - Implemented count elements handler for RarArchive.
- 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
2010-05-30 00:51:55 +00:00
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
cataphract
a72bceba89 Minor improvements, let's hope it compiles on linux.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@299746 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-25 17:06:19 +00:00
cataphract
d2e33c32c0 Fixed a few bugs, memory leaks and removed some old compatibility code.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@299743 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-25 16:00:45 +00:00
cataphract
b081085cc9 Added option to RarEntry::extract() to allow from extraction of ACL (windows)/owner (unix)/extended attributes (os/2)
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@299044 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-05 23:43:28 +00:00
cataphract
ffde50b702 Fixed RarEntry::extract not really accepting a password.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@299004 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-05 01:06:21 +00:00
cataphract
8bab79ae80 Exposed access time and creation time for stat/fstat.
Used the high precision modification time to create the time_t for stat/fstat, if it exists.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298999 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-05 00:04:16 +00:00
cataphract
dadab995f5 Directory streams and url stat implemented.
Exposed UnRAR DLL API version in MINFO.
Refactoring and a few other minor changes.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298980 c90b9560-bf6c-de11-be94-00142212c4b1
2010-05-04 17:17:01 +00:00
cataphract
0f950603be Refactoring.
Fixed tests 49 and 56.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298807 c90b9560-bf6c-de11-be94-00142212c4b1
2010-04-30 14:48:07 +00:00
cataphract
a88a995ca0 Added extflow.txt.
Added technote.txt.
Added rar_file_t::entries_idx. It's a hashtable that stores the entries in rar_file_t::entries indexed by name. _rar_raw_entries_to_files uses it, if available.
Added an extension global, a per-request cache that will be used when directory streams are implemented.
Eliminated dependency on SPL.
Substituted several legacy macro names for new ones.
Stream close operation operates differently when close_handle is FALSE (not that I actually know what the correct behaviour would be...)
Added rar stream stat operation.
Added wrapper, not with only an opener. The syntax is "rar://<urlencoded path to RAR archive>#<urlencoded entry name>". Context options should be under "rar" and are "open_password", "file_password" and "volume_callback"
extract() and the wrapper opener should support RAR files with header passwords different from file passwords (but WinRAR does not generate them, so not tested).
Avoid test 46 infinite loop on resource opening failure.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298704 c90b9560-bf6c-de11-be94-00142212c4b1
2010-04-28 15:42:06 +00:00
cataphract
99996abdb9 Fixed test 49.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298403 c90b9560-bf6c-de11-be94-00142212c4b1
2010-04-23 22:57:50 +00:00
cataphract
eb12649fb2 Tests for when MAXPATHLEN > 1024 and improved resilience to possible unterminated strings in the unRAR lib (shouldn't happen anyway).
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298400 c90b9560-bf6c-de11-be94-00142212c4b1
2010-04-23 22:42:24 +00:00
cataphract
506493c52d Added volume find callback to RarArchive::open/rar_open.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298372 c90b9560-bf6c-de11-be94-00142212c4b1
2010-04-23 11:01:14 +00:00
cataphract
3c8d037135 Added test for files when unpacked size bigger than 2 GiB (it will take some effort to do the same for packed size > 2 GiB).
Relaxed test #12 (changes to the unpacking algorithm in unrar 3.9.10 have apparently changed the output stream for corrupted entries).

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298254 c90b9560-bf6c-de11-be94-00142212c4b1
2010-04-21 14:13:43 +00:00
cataphract
670290aad1 Renamed RarArchive::list() to RarArchive::getEntries() (see bug #17025). The old name of the method can be activated by defining RAR_ARCHIVE_LIST_ALIAS.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@298209 c90b9560-bf6c-de11-be94-00142212c4b1
2010-04-20 11:32:30 +00:00
cataphract
7288320a37 Fixed infinite loop when opening files with missing volumes.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@295909 c90b9560-bf6c-de11-be94-00142212c4b1
2010-03-07 00:43:31 +00:00
cataphract
02855820f7 Fixed test 32 (trivial).
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@293638 c90b9560-bf6c-de11-be94-00142212c4b1
2010-01-17 08:54:43 +00:00
cataphract
5f7b823e40 Fixed two bugs:
RarArchive get iterator on closed file caused crash.
rararch_it_current_data was copying the address of a stack allocated variable. Only caught this when testing on release PHP 5.2 under Linux.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@293637 c90b9560-bf6c-de11-be94-00142212c4b1
2010-01-17 08:46:30 +00:00
cataphract
36b2b5d2fc Hopefully fixed non-ZTS compilation.
Fixed test #34.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@292692 c90b9560-bf6c-de11-be94-00142212c4b1
2009-12-27 15:58:53 +00:00
cataphract
4e2dc20b2d Renamed rar_solid_get to rar_solid_is.
RarException::setUsingExceptions no longer returns anything.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@292614 c90b9560-bf6c-de11-be94-00142212c4b1
2009-12-24 20:28:10 +00:00
cataphract
7da530c6e3 Added error handling with exceptions.
Introduction of RarException.
Added rar_solid_get
RarEntry and RarArchive cannot be instantiated in user space.
Quite some refactoring.

git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@292412 c90b9560-bf6c-de11-be94-00142212c4b1
2009-12-21 14:04:56 +00:00
cataphract
444ee4b790 RarArchive made traversable.
git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@292194 c90b9560-bf6c-de11-be94-00142212c4b1
2009-12-16 10:49:54 +00:00
cataphract
67d29529f1 Fix for Linux compilation.
Tests correction and relaxation where required.


git-svn-id: http://svn.php.net/repository/pecl/rar/trunk@291822 c90b9560-bf6c-de11-be94-00142212c4b1
2009-12-07 16:08:33 +00:00