95 Commits

Author SHA1 Message Date
Gustavo Lopes 78b7a5f63b Add musl-based build environment and Docker CI infrastructure
Add a musl/LLVM Docker build environment for compiling portable Linux
binaries that work on both musl and glibc systems, along with a minimal
PHP Docker image for testing. Add CI workflows to build and publish
these images to ghcr.io. Update test and build scripts to use the new
Docker-based environment, and remove SKIPIF guards from tests since the
extension is always present and doing otherwise would mask extension
loading failures.
2026-03-14 22:31:52 +00:00
Gustavo Lopes 132badcf53 Fix #75557: Error opening archive w/non-english chars in path
Make it consistent with the rest of the extension, which assumes MBS
paths as being in UTF-8.
2026-03-11 01:38:21 +00:00
Gustavo Lopes d58737756c Fix release build on 32-bit windows 2026-03-09 00:19:32 +00:00
Gustavo Lopes ea74acb27b Remove NM definition. Size of P1 in actually MAXPATHSIZE 2026-03-08 21:48:41 +00:00
Gustavo Lopes f6650b4abe Remove PHP 5 support 2026-03-08 15:11:27 +00:00
Gustavo Lopes be202cc5b1 Add PHP 8.3 CI support; fix type-error wording in tests
Wire up PHP 8.3 Linux matrix jobs and Justfile targets. Fix three EXPECTF
patterns in tests/002, 003, 008: PHP 8.3 changed the type-error message
wording from "bool given" to "false given", so widen "boo%s" to "%s" to
match both old and new phrasing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 15:11:16 +00:00
Gustavo Lopes 77cc02a1db Fix RAR5 chunk extraction spurious warning on Windows with multi-core CPUs
On Windows, RAR_SMP is defined and Unpack5MT is used when MaxUserThreads > 1
(i.e. on any multi-core machine). Unlike Unpack5, Unpack5MT does not set
FileExtracted = true on completion, leaving it false after SetDestSize() clears
it. In chunk extraction mode (suspendAfterInit = true), this caused
RARProcessFileChunk to return *finished = false even after writing all data,
triggering a second unnecessary call that wrote 0 bytes and fired the spurious
"Extraction reported as unfinished but no data read" warning.

Fix by skipping Unpack5MT when suspendAfterInit is true, falling through to
Unpack5 which correctly implements the suspend/resume protocol. The existing
comment in DoUnpack already noted that Unpack5MT must not be used in suspended
mode; the condition just wasn't enforced.

Remove the now-stale Appveyor skip from test 101.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 17:33:13 +00:00
Gustavo Lopes ab26d28575 Fixes for PHP 8.1 2021-08-16 01:28:05 +01:00
Gustavo Lopes d95cab037b Support PHP 8 2020-12-06 19:18:01 +00:00
Gustavo Lopes 5b94797037 Backport PHP8's run-tests.php 2020-12-06 19:18:01 +00:00
Gustavo Lopes 095b4cdd58 Fix PHP 7.4 valgrind tests 2020-10-11 18:38:57 +01:00
Gustavo Lopes 2788a30227 Warn when we read more data than the file's declared size
Last commit changed how data is read for solid files, but this had a
side effect in that the data returned by the unrar lib was no longer
limited to the size of the file, as declared in its header.

Still keep this new behavior, but add a warning when this happens.
2020-10-11 17:30:15 +01:00
Gustavo Lopes e0c6c97ef0 Fix bug 76592: streaming unpacking of uncompressed files incomplete 2020-10-11 17:30:15 +01:00
Gustavo Lopes e3f3ecd1ab Update to unrar 5.9.2 2020-09-27 23:36:29 +01:00
Remi Collet 1225c9240e relax tests for 7.3 (bool/boolean, main/count) 2018-06-26 15:22:42 +02:00
Gustavo Lopes b79f595379 Add tests for RarEntry functions w/out one 2017-07-22 02:33:25 +01:00
Gustavo Lopes 479372f714 Fix redir functions; add test 2017-07-22 02:33:25 +01:00
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