wp-update-server-plugin/composer.json
David Stone 21e011921d fix: feature-detect GLOB_BRACE for musl-libc PHP builds
The vendored yahnis-elsts/wp-update-server library calls glob() with
GLOB_BRACE | GLOB_NOESCAPE. GLOB_BRACE is not defined on PHP builds
linked against musl libc (Alpine, the official static FrankenPHP
releases). In PHP 8 this triggers a fatal 'Uncaught Error: Undefined
constant GLOB_BRACE' in Wpup_UpdateServer::findFirstAsset() every time
the update API tries to resolve a plugin banner or icon asset.

Add a Composer patch (via cweagans/composer-patches) that switches to
runtime feature detection: when GLOB_BRACE is available, behaviour is
identical; when it is missing, fall back to one glob() call per
extension and merge the results. The patched UpdateServer.php is also
committed so existing deployments (which ship vendor/ as-is) pick up
the fix without re-running composer install.

An equivalent upstream PR is being submitted to YahnisElsts/wp-update-server.
2026-05-13 02:11:55 -06:00

38 lines
1.1 KiB
JSON

{
"name": "ultimate-multisite/ultimate-update-server-plugin",
"url": "https://wpmultisitewaas.org",
"description": "Create an update server with Woocommerce downloadable products.",
"version": "1.0.0",
"authors": [
{
"name": "David Stone",
"homepage": "https://github.com/superdav42"
}
],
"license": [
"GPL-3.0-or-later"
],
"type": "wordpress-plugin",
"require": {
"yahnis-elsts/wp-update-server": "^2.0",
"cweagans/composer-patches": "^1.7"
},
"require-dev": {
"szepeviktor/phpstan-wordpress": "^2.0",
"phpstan/extension-installer": "^1.1"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
"cweagans/composer-patches": true
}
},
"extra": {
"patches": {
"yahnis-elsts/wp-update-server": {
"Feature-detect GLOB_BRACE for musl-libc PHP builds (Alpine, static FrankenPHP)": "patches/wp-update-server-glob-brace-musl.patch"
}
},
"composer-exit-on-patch-failure": true
}
}