Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable requirement check for specific extension? #1248

Open
caendesilva opened this issue Dec 9, 2023 · 2 comments
Open

Disable requirement check for specific extension? #1248

caendesilva opened this issue Dec 9, 2023 · 2 comments

Comments

@caendesilva
Copy link

caendesilva commented Dec 9, 2023

Hey! I've looked through the issues and skimmed through the source and searched the docs and haven't found a mention of this, but is there any way to disable/suppress the requirement check for a specific extension?

For context to my actual use case (hydephp/cli#5), a downstream dependency in my project requires the fileinfo extension, due to this, the generated Phar also requires that extension. But my code actually works without the extension as I'm not using any of the features that requires the extension. Is there a way I can disable this whilst keeping the other requirement checks that are actually applicable?

@theofidry
Copy link
Member

is there any way to disable/suppress the requirement check for a specific extension?

There isn't really a way to do so unfortunately. The requirement can either not be shipped or disabled at runtime via the environment variable (BOX_REQUIREMENT_CHECKER=0).

But my code actually works without the extension as I'm not using any of the features that requires the extension

Doesn't that mean that fileinfo should not be really required by this package but rather suggested only?

A workaround maybe though would be to add a provide section to your composer.json (ideally only for the PHAR?).

@caendesilva
Copy link
Author

caendesilva commented Dec 9, 2023

Thanks for the fast response! I'm going to take a closer look at this tomorrow.

Doesn't that mean that fileinfo should not be really required by this package but rather suggested only?

Unfortunately, this requirement is made in a package that one of the packages I depend on depends on. Users of the original package probably need the requirement, but since I don't use all the features from the package, I personally don't need it. I hope that makes sense. Dependencies with dependencies gets messy.

A workaround maybe though would be to add a provide section to your composer.json (ideally only for the PHAR?).

That could work, I'll try it out and let you know, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants