Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
f367a22
Added unrar 6.0.3
cataphract Feb 28, 2026
c00e9c1
Added unrar 6.0.4
cataphract Feb 28, 2026
1502c09
Added unrar 6.0.5
cataphract Feb 28, 2026
b7ec361
Added unrar 6.0.6
cataphract Feb 28, 2026
0922854
Added unrar 6.0.7
cataphract Feb 28, 2026
2f979b4
Added unrar 6.1.1
cataphract Feb 28, 2026
d7a5b2c
Added unrar 6.1.2
cataphract Feb 28, 2026
63a7b8b
Added unrar 6.1.3
cataphract Feb 28, 2026
efddae4
Added unrar 6.1.4
cataphract Feb 28, 2026
3fcd7f1
Added unrar 6.2.1
cataphract Feb 28, 2026
4594bd1
Added unrar 6.1.5
cataphract Feb 28, 2026
412c7bf
Added unrar 6.2.2
cataphract Feb 28, 2026
571deed
Added unrar 6.2.3
cataphract Feb 28, 2026
d2b8283
Added unrar 6.2.4
cataphract Feb 28, 2026
cc7d8e8
Added unrar 6.2.5
cataphract Feb 28, 2026
e63362d
Added unrar 6.2.6
cataphract Feb 28, 2026
340695b
Added unrar 6.2.7
cataphract Feb 28, 2026
094a536
Added unrar 6.2.8
cataphract Feb 28, 2026
f57721d
Added unrar 6.2.9
cataphract Feb 28, 2026
294d87a
Added unrar 7.0.1
cataphract Feb 28, 2026
b810988
Added unrar 7.0.2
cataphract Feb 28, 2026
abb9fa4
Added unrar 7.0.3
cataphract Feb 28, 2026
a657432
Added unrar 7.0.4
cataphract Feb 28, 2026
9f17788
Added unrar 7.0.5
cataphract Feb 28, 2026
0a08604
Added unrar 7.0.6
cataphract Feb 28, 2026
95fe328
Added unrar 7.0.7
cataphract Feb 28, 2026
9a5d712
Added unrar 7.0.8
cataphract Feb 28, 2026
5823bb1
Added unrar 7.0.9
cataphract Feb 28, 2026
55a5663
Added unrar 7.1.1
cataphract Feb 28, 2026
1c76380
Added unrar 7.1.2
cataphract Feb 28, 2026
d21e05b
Added unrar 7.1.3
cataphract Feb 28, 2026
899eb2c
Added unrar 7.1.4
cataphract Feb 28, 2026
320f84b
Added unrar 7.1.5
cataphract Feb 28, 2026
366007b
Added unrar 7.2.1
cataphract Feb 28, 2026
9babd4f
Added unrar 7.2.2
cataphract Feb 28, 2026
40a7872
Added unrar 7.2.3
cataphract Feb 28, 2026
823315f
Added unrar 7.2.4
cataphract Feb 28, 2026
0131eef
Use zend_long in lieu of long where appropriate
cataphract Feb 28, 2026
77cc02a
Fix RAR5 chunk extraction spurious warning on Windows with multi-core…
cataphract Mar 1, 2026
3dcba94
Migrate CI from Azure Pipelines/Appveyor to GitHub Actions
cataphract Feb 28, 2026
4a4e67e
Moderninze run-tests.php; use it on windows CI too
cataphract Mar 1, 2026
5e063a9
Add PHP 8.1 CI support
cataphract Mar 1, 2026
eb1a919
Document php upgrade procedure.
cataphract Mar 1, 2026
6a2ec1c
Add PHP 8.2 CI support; fix __toString arginfo
cataphract Mar 1, 2026
be202cc
Add PHP 8.3 CI support; fix type-error wording in tests
cataphract Mar 1, 2026
f6650b4
Remove PHP 5 support
cataphract Mar 2, 2026
5e74ad9
Update unrar_update.md
cataphract Mar 8, 2026
88773b4
Merge unrar 6.1.5
cataphract Mar 8, 2026
ae9a462
Fix isnt.cpp: wrap Windows-only code in #ifdef _WIN_ALL
cataphract Mar 8, 2026
0c05fac
Merge unrar 6.2.9
cataphract Mar 8, 2026
0cace1d
Fix extract.cpp: fix brace mismatch in password check block after 6.2…
cataphract Mar 8, 2026
ff2aa63
Merge unrar 7.0.9
cataphract Mar 8, 2026
3f536c9
Fix os.hpp: restore NM define removed in unrar 7.0
cataphract Mar 8, 2026
371536d
Fix arccmt.cpp: remove extra brace introduced during 6.2.9 conflict r…
cataphract Mar 8, 2026
2d3b968
Update extractchunk.cpp for unrar 7.0 std::wstring API changes
cataphract Mar 8, 2026
055906e
Fix rarentry.c: zero-initialize RARHeaderDataEx to prevent segfault
cataphract Mar 8, 2026
10e3e32
Merge unrar 7.1.5
cataphract Mar 8, 2026
a169ed9
Fix build: add largepage.cpp, exclude motw.cpp (Windows-only) for unr…
cataphract Mar 8, 2026
440d2a1
Merge unrar 7.2.4
cataphract Mar 8, 2026
89ac57c
Fix dll.cpp: don't propagate non-fatal ErrHandler errors as failures
cataphract Mar 8, 2026
e5b9669
Add but don't apply .clang-format
cataphract Mar 8, 2026
1b6a2a5
Fix windows build
cataphract Mar 8, 2026
ea74acb
Remove NM definition. Size of P1 in actually MAXPATHSIZE
cataphract Mar 8, 2026
4115c69
Fix wrong printf format
cataphract Mar 8, 2026
b482f2f
Add largepage.cpp and motw.cpp to Windows build config
cataphract Mar 8, 2026
05c8e5e
Fix warning
cataphract Mar 8, 2026
4e914be
.gitignore
cataphract Mar 8, 2026
1f1baf4
Fix for 32-bit windows
cataphract Mar 8, 2026
b79e649
Prepare 4.3.0 release
cataphract Mar 8, 2026
d587377
Fix release build on 32-bit windows
cataphract Mar 9, 2026
b6d9dc8
Update README.md
cataphract Mar 9, 2026
60eaceb
Fix version
remicollet Mar 9, 2026
d9bc8cd
Merge pull request #26 from remicollet/patch-1
cataphract Mar 9, 2026
2ef087b
Version validation in CI
cataphract Mar 9, 2026
b4d6634
Do not build linux binaries on release
cataphract Mar 9, 2026
536aa7a
Move -Wall behind -Wno-...
cataphract Mar 11, 2026
132badc
Fix #75557: Error opening archive w/non-english chars in path
cataphract Mar 11, 2026
78b7a5f
Add musl-based build environment and Docker CI infrastructure
cataphract Mar 14, 2026
755f366
Linux builds for releases (8.1+)
cataphract Mar 15, 2026
d28125c
Release v4.3.1
cataphract Mar 15, 2026
f1acbb6
Bump version to 4.3.2-dev
cataphract Mar 15, 2026
d049646
Correct comments on glibc_compat.c; call abort() in res_init
cataphract Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
88 changes: 88 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
# Formatting style for php-rar C source files.
# Does NOT apply to unrar/ (see unrar/.clang-format).
Language: Cpp
BasedOnStyle: LLVM

# Indentation: real tabs, width 4 (matches vim modeline: noet sw=4 ts=4)
UseTab: Always
TabWidth: 4
IndentWidth: 4
ContinuationIndentWidth: 4

# Disable line-length wrapping to preserve hand-formatted long lines
ColumnLimit: 0

# Brace style:
# - Functions: brace on its own line (Allman)
# - Structs/unions/enums/extern "C": brace attached (K&R)
# - Control statements: brace attached (K&R)
# - else/else if: on its own line (after closing })
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false

# Preserve indentation of preprocessor directives (# include, # define inside #ifdef)
IndentPPDirectives: AfterHash
PPIndentWidth: 1

# Pointer star attached to variable name: char *ptr
PointerAlignment: Right
DerivePointerAlignment: false

# Spaces
SpaceBeforeParens: ControlStatements
SpaceAfterCStyleCast: true
SpacesInParentheses: false
SpaceInEmptyParentheses: false
SpaceBeforeAssignmentOperators: true

# Don't align backslashes in multi-line macros (just 1 space before \)
AlignEscapedNewlines: DontAlign

# ZEND_BEGIN/END_ARG_INFO_EX act as block delimiters so ZEND_ARG_INFO lines
# inside them keep their indentation.
MacroBlockBegin: "^ZEND_BEGIN_ARG_INFO"
MacroBlockEnd: "^ZEND_END_ARG_INFO"

# Align continuation arguments after opening paren; when ( is last on the line,
# fall back to a block indent (ContinuationIndentWidth).
AlignAfterOpenBracket: Align

# Preserve existing include order
SortIncludes: Never

# case labels are indented one level inside switch
IndentCaseLabels: true

# Don't collapse or expand short constructs
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false

# Alignment: leave hand-aligned blocks alone
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignTrailingComments: false

# Blank lines
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: true
32 changes: 32 additions & 0 deletions .github/docker-image-shas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Docker image SHA lock file.
# Maps image tags to their multi-arch OCI index digests (amd64 + arm64).
# Regenerate with: .github/scripts/update-docker-shas.sh

ghcr.io/cataphract/php-minimal:
7.0-debug: "sha256:c1a08b9c71b30c3ed4c31bb6ca9f4c81f82f4351c5e6e0c423a8f980ce3c89ee"
7.0-release-zts: "sha256:9d9f1b1337822e1c069cf49c22f5f6b55ba806547cccbb4836e847fe8e32819a"
7.1-debug: "sha256:b670b5de5dd8d0791a86b29e336b5a7d801fbdeaeadf9148e616cf5357b9035e"
7.1-release-zts: "sha256:1f3164d4cdd57faa0911de43c4c77b7d18fdf84971db97ff2889f1a5ed8a0e5a"
7.2-debug: "sha256:7c1d2b2248a64339d8b0ae7bcbe4156fc8e3903653ce1d86347bfeacb9679c0d"
7.2-release-zts: "sha256:5e1f47179d730c22c8eada20f9cbedb034f3b97c89174ce4e6108e7d76bf7da5"
7.3-debug: "sha256:b0b4c0a57e52011469c7999b330020d4ef27628eb8ac745e7e74796c8ff8601a"
7.3-release-zts: "sha256:fe021f3979bc4c69be0d73ec74a30085915939a62f457557be91e003938d6e0a"
7.4-debug: "sha256:d2d827524eae4a7d391b5f71b33477a1affabc74f674f9680b7838c3a5154d7f"
7.4-release-zts: "sha256:6c5eacd2f493c1c07a68f451b72a62ed67ddb2406dab8e3dc82f20adc7e72bf7"
8.0-debug: "sha256:d46c15e648497cf55bb6b4806c726c58714f5b63fcb1096e4a8ec433ec17c835"
8.0-release-zts: "sha256:bcbaab72e7c0e704d7bdef01e8f91e1bc0636e6e98c0ab68cc2fc417e7a98a66"
8.1-debug: "sha256:dbdb437df0a4acbbd11e020461f7cef2f0e949f46f9ca841c5f058012ec7cc98"
8.1-release: "sha256:f401dba3b4249dc16acb90909951b88e3146dcd2e622203d95e80219258932c9"
8.1-release-zts: "sha256:2b330ce54679f29e09ea77c984cd409618142cc20cab48b5a114cc1e5b09257c"
8.2-debug: "sha256:efecf1cdbd09511aec12897a03682934243498c5bb2ba37874ae2100c1498011"
8.2-release: "sha256:e09be007096a29d64427afa99ea4d10f7e1a91a8e2129aeaa854daf045986d8f"
8.2-release-zts: "sha256:d67d1c370abdc5e629a2bec1ff4d308f0ccb7d3cbc7ecc3c7eee851cd6c2efaa"
8.3-debug: "sha256:1b8e6ba17c837a4035f6981dd38f9f447be57a3d558ca8f18071c8390a62ce6c"
8.3-release: "sha256:23abac21af8c95ccd6cd6a8b5fbb2d1dd67e122fc7630bbbfcc7b75e6a6fcc96"
8.3-release-zts: "sha256:158060357f81b495a5420b1f9d488abd61d59306946b352e4fbfc4011b7a2d89"
8.4-debug: "sha256:c863e2a60f144856f56d50ed1080bbe0377ca99760195f170c762ad46f0466e5"
8.4-release: "sha256:571251d31267c6960846727f0788f1d9a593a02adf6a68899a0582c5635d5c50"
8.4-release-zts: "sha256:6451c7104d874f8c4f7e0305e5baaecebbd74672a036c02de2cbb9d1a10c8906"
8.5-debug: "sha256:014a16949dd0da0581cda6768bd7751f66b6ada3becdc949aeb5b8e1efb3c5cf"
8.5-release: "sha256:bc58405b860c17ea5f36cbd466dc5c93b97283c148e3489ec78171d73727859c"
8.5-release-zts: "sha256:dadd96c4740bc9606f2985be51fb0b85d768132f93786c4ae52940552f3cbdc6"
39 changes: 39 additions & 0 deletions .github/scripts/build-and-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Build the extension and run the test suite.
# Expected to run inside a php-minimal container from the repo root.
set -euo pipefail

# Clean up all generated files so stale objects from a previous PHP version or
# build variant don't silently survive into this build.
if [ -f Makefile ]; then
make -f Makefile distclean
fi
# Remove any leftover object files even if Makefile is gone (e.g. after a
# partial prior build that ended before distclean could run).
find . -name '*.lo' -o -name '*.o' | xargs rm -f 2>/dev/null || true
find . -name '.libs' -type d | xargs rm -rf 2>/dev/null || true

phpize
./configure --with-php-config="$(which php-config)"
make -f Makefile -j"$(nproc)"

# The generated Makefile silences and ignores errors on the `if` commands;
# undo that so test failures surface properly.
sed -i 's/-@if/@if/' Makefile

ret=0
TEST_PHP_EXECUTABLE="$(which php)" \
TEST_PHP_JUNIT=report.xml \
REPORT_EXIT_STATUS=1 \
NO_INTERACTION=1 \
TESTS="--set-timeout 300 --show-diff" \
make -f Makefile test || ret=$?

found=$(find tests -name '*.mem' | wc -l)
if [ "$found" -gt 0 ]; then
echo "Found $found memory leak(s):"
find tests -name '*.mem' -print -exec cat {} \;
ret=1
fi

exit "$ret"
61 changes: 61 additions & 0 deletions .github/scripts/update-docker-shas.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
# Refresh docker-image-shas.yml with current OCI index digests.
# The index digest covers all platforms (amd64 + arm64); Docker resolves the
# right platform image from it at pull time.
# Justfile and tests.yml read from docker-image-shas.yml directly — no patching needed.
set -euo pipefail

IMAGE="ghcr.io/cataphract/php-minimal"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LOCK_FILE="$SCRIPT_DIR/../docker-image-shas.yml"

TAGS=(
7.0-debug 7.0-release-zts
7.1-debug 7.1-release-zts
7.2-debug 7.2-release-zts
7.3-debug 7.3-release-zts
7.4-debug 7.4-release-zts
8.0-debug 8.0-release-zts
8.1-debug 8.1-release 8.1-release-zts
8.2-debug 8.2-release 8.2-release-zts
8.3-debug 8.3-release 8.3-release-zts
8.4-debug 8.4-release 8.4-release-zts
8.5-debug 8.5-release 8.5-release-zts
)

get_index_digest() {
local tag="$1" digest attempt
for attempt in 1 2 3; do
digest=$(docker buildx imagetools inspect "${IMAGE}:${tag}" \
| awk '/^Digest:/ { print $2; exit }')
if [[ -n "$digest" ]]; then
echo "$digest"
return 0
fi
echo "Attempt $attempt failed for $tag, retrying..." >&2
sleep $((attempt * 5))
done
echo "ERROR: could not fetch digest for $tag after 3 attempts" >&2
return 1
}

# Collect all digests first so we fail fast before touching any file.
declare -A DIGESTS
for tag in "${TAGS[@]}"; do
echo "Fetching $tag ..." >&2
DIGESTS[$tag]=$(get_index_digest "$tag")
done

# ── Update docker-image-shas.yml ─────────────────────────────────────────────

{
echo "# Docker image SHA lock file."
echo "# Maps image tags to their multi-arch OCI index digests (amd64 + arm64)."
echo "# Regenerate with: .github/scripts/update-docker-shas.sh"
echo ""
echo "${IMAGE}:"
for tag in "${TAGS[@]}"; do
printf " %-20s \"%s\"\n" "${tag}:" "${DIGESTS[$tag]}"
done
} > "$LOCK_FILE"
echo "Updated $LOCK_FILE" >&2
162 changes: 162 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Build Docker images

on:
push:
branches: [docker]

env:
MUSL_ENV_IMAGE: ghcr.io/cataphract/musl-build-env
PHP_IMAGE: ghcr.io/cataphract/php-minimal

jobs:
# ── Push: build musl-build-env for both arches ───────────────────────────
musl-build-env:
name: musl-build-env / ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- arch: x86_64
platform: linux/amd64
runner: ubuntu-latest
- arch: aarch64
platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: docker/musl-build-env
platforms: ${{ matrix.platform }}
push: true
tags: ${{ env.MUSL_ENV_IMAGE }}:latest-${{ matrix.arch }}
build-args: ARCH=${{ matrix.arch }}
cache-from: type=gha,scope=musl-build-env-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=musl-build-env-${{ matrix.arch }}

# ── Push: build php-minimal for all PHP versions and variants ─────────────
php-minimal:
name: php-minimal ${{ matrix.php }}-${{ matrix.variant }} / ${{ matrix.arch }}
needs: musl-build-env
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
php:
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
variant:
- debug
- release
- release-zts
arch:
- x86_64
- aarch64
include:
- arch: x86_64
platform: linux/amd64
runner: ubuntu-latest
- arch: aarch64
platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Resolve PHP patch version and build flags
id: cfg
run: |
declare -A PHP_VERSIONS=(
[7.0]=7.0.33 [7.1]=7.1.33 [7.2]=7.2.34 [7.3]=7.3.33 [7.4]=7.4.33
[8.0]=8.0.30 [8.1]=8.1.32 [8.2]=8.2.28 [8.3]=8.3.19 [8.4]=8.4.6
[8.5]=8.5.0
)
patch="${PHP_VERSIONS[${{ matrix.php }}]}"
case "${{ matrix.variant }}" in
debug) debug=yes; zts=no ;;
release) debug=no; zts=no ;;
release-zts) debug=no; zts=yes ;;
esac
echo "patch=${patch}" >> "$GITHUB_OUTPUT"
echo "debug=${debug}" >> "$GITHUB_OUTPUT"
echo "zts=${zts}" >> "$GITHUB_OUTPUT"

- name: Build and push
uses: docker/build-push-action@v6
with:
context: docker/php-minimal
platforms: ${{ matrix.platform }}
push: true
tags: ${{ env.PHP_IMAGE }}:${{ matrix.php }}-${{ matrix.variant }}-${{ matrix.arch }}
build-args: |
BUILD_ENV_IMAGE=${{ env.MUSL_ENV_IMAGE }}:latest-${{ matrix.arch }}
PHP_VERSION=${{ steps.cfg.outputs.patch }}
ARCH=${{ matrix.arch }}
PHP_ENABLE_DEBUG=${{ steps.cfg.outputs.debug }}
PHP_ENABLE_ZTS=${{ steps.cfg.outputs.zts }}
cache-from: type=gha,scope=php-${{ matrix.php }}-${{ matrix.variant }}-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=php-${{ matrix.php }}-${{ matrix.variant }}-${{ matrix.arch }}

# ── Push: create multi-arch manifests ────────────────────────────────────
merge-manifests:
name: Create multi-arch manifests
needs: php-minimal
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Merge musl-build-env manifest
run: |
docker buildx imagetools create \
-t ${{ env.MUSL_ENV_IMAGE }}:latest \
${{ env.MUSL_ENV_IMAGE }}:latest-x86_64 \
${{ env.MUSL_ENV_IMAGE }}:latest-aarch64

- name: Merge php-minimal manifests
run: |
for minor in 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5; do
for variant in debug release release-zts; do
docker buildx imagetools create \
-t ${{ env.PHP_IMAGE }}:${minor}-${variant} \
${{ env.PHP_IMAGE }}:${minor}-${variant}-x86_64 \
${{ env.PHP_IMAGE }}:${minor}-${variant}-aarch64
done
done
Loading