Skip to content

Add missing ext-filter dependency#922

Merged
DannyvdSluijs merged 1 commit into
jsonrainbow:mainfrom
TimWolla:patch-1
Jul 3, 2026
Merged

Add missing ext-filter dependency#922
DannyvdSluijs merged 1 commit into
jsonrainbow:mainfrom
TimWolla:patch-1

Conversation

@TimWolla

@TimWolla TimWolla commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Trying to run composer in a PHP build without ext-filter fails with:

Error: Call to undefined function JsonSchema\Uri\filter_var()
Fatal error: Uncaught Error: Call to undefined function JsonSchema\Uri\filter_var() in phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php:84
Stack trace:
#0 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(100): JsonSchema\Uri\UriResolver->resolve('*redacted*...', 'internal://prov...')
#1 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(76): JsonSchema\SchemaStorage->expandRefs(Object(stdClass), 'internal://prov...')
#2 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php(67): JsonSchema\SchemaStorage->addSchema('internal://prov...', Object(stdClass))
#3 phar:///*redacted*/bin/composer/src/Composer/Json/JsonFile.php(258): JsonSchema\Validator->validate(Object(stdClass), Object(stdClass))
#4 phar:///*redacted*/bin/composer/src/Composer/Json/JsonFile.php(214): Composer\Json\JsonFile::validateJsonSchema('./composer.json', Object(stdClass), 1, '*redacted*...')
#5 phar:///*redacted*/bin/composer/src/Composer/Factory.php(313): Composer\Json\JsonFile->validateSchema(1)
#6 phar:///*redacted*/bin/composer/src/Composer/Factory.php(631): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), './composer.json', true, '*redacted*...', true, false)
#7 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(629): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, true, false)
#8 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(538): Composer\Console\Application->getComposer(false, true)
#9 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(485): Composer\Console\Application->hintCommonErrors(Object(Error), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 phar:///*redacted*/bin/composer/vendor/symfony/console/Application.php(171): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(141): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 phar:///*redacted*/bin/composer/bin/composer(112): Composer\Console\Application->run()
#13 /*redacted*/bin/composer(29): require('*redacted*...')
#14 {main}
  thrown in phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php on line 84
Error: Process completed with exit code 255.

Related Issue

n/a

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Other (please describe):

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the code style of this project
  • I have added tests that prove my fix is effective or that my feature works
  • All new and existing tests pass
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional Notes

Metadata-only change, so much of the checklist is not really applicable. Type of change is also somewhere between “Bug fix” and “Documentation update”.

Trying to run composer in a PHP build without ext-filter fails with:

    Error: Call to undefined function JsonSchema\Uri\filter_var()
    Fatal error: Uncaught Error: Call to undefined function JsonSchema\Uri\filter_var() in phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php:84
    Stack trace:
    #0 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(100): JsonSchema\Uri\UriResolver->resolve('*redacted*...', 'internal://prov...')
    #1 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(76): JsonSchema\SchemaStorage->expandRefs(Object(stdClass), 'internal://prov...')
    #2 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php(67): JsonSchema\SchemaStorage->addSchema('internal://prov...', Object(stdClass))
    #3 phar:///*redacted*/bin/composer/src/Composer/Json/JsonFile.php(258): JsonSchema\Validator->validate(Object(stdClass), Object(stdClass))
    #4 phar:///*redacted*/bin/composer/src/Composer/Json/JsonFile.php(214): Composer\Json\JsonFile::validateJsonSchema('./composer.json', Object(stdClass), 1, '*redacted*...')
    #5 phar:///*redacted*/bin/composer/src/Composer/Factory.php(313): Composer\Json\JsonFile->validateSchema(1)
    #6 phar:///*redacted*/bin/composer/src/Composer/Factory.php(631): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), './composer.json', true, '*redacted*...', true, false)
    #7 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(629): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, true, false)
    #8 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(538): Composer\Console\Application->getComposer(false, true)
    #9 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(485): Composer\Console\Application->hintCommonErrors(Object(Error), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #10 phar:///*redacted*/bin/composer/vendor/symfony/console/Application.php(171): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #11 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(141): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #12 phar:///*redacted*/bin/composer/bin/composer(112): Composer\Console\Application->run()
    #13 /*redacted*/bin/composer(29): require('*redacted*...')
    #14 {main}
      thrown in phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php on line 84
    Error: Process completed with exit code 255.
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🎉 You're making a difference! We appreciate your effort and dedication. A reviewer will check it out soon, but in the meantime, give yourself a pat on the back. Keep up the great work! 💪🚀

⭐ Enjoying contributing? Star the project! ⭐Your contributions help this project grow, and we'd love your support in another way too! If you find this repo helpful, consider leaving a star 🌟 on GitHub.

@Seldaek

Seldaek commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@TimWolla looks like we have a few filter_var calls in Composer too so I guess we should depend on it too :)

Edit: composer/composer@c6c9144 - we already check for it in the installer code tho.

@TimWolla

TimWolla commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

we already check for it in the installer code tho.

I’m installing composer in CI using gh CLI:

gh release --repo composer/composer download --pattern composer.phar
gh attestation verify --repo composer/composer composer.phar

But other than that, I’m also running a very … bespoke CI set-up with custom builds of PHP, which is how I noticed this issue.

@DannyvdSluijs DannyvdSluijs merged commit f2babc9 into jsonrainbow:main Jul 3, 2026
19 checks passed
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

💖 Welcome @TimWolla as first-time contributor! Your efforts matter, and we’re so grateful for your contribution. Open source thrives because of people like you. Keep going, keep learning, and know that your work is truly valued. 🌱✨

⭐ Enjoying contributing? Star the project! ⭐Your contributions help this project grow, and we'd love your support in another way too! If you find this repo helpful, consider leaving a star 🌟 on GitHub.

@DannyvdSluijs

Copy link
Copy Markdown
Collaborator

Thanks @TimWolla

@TimWolla TimWolla deleted the patch-1 branch July 3, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants