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

Force extension with --use-ext #23

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Force extension with --use-ext #23

wants to merge 2 commits into from

Conversation

jleonardolemos
Copy link
Contributor

@jleonardolemos jleonardolemos commented May 22, 2021

Closes #22

Add an --use-ext option in order to provide a way to force a specific zip tool as the follow:

php security-checker security:check /path/to/composer.lock --use-ext system-unzip

We can use system-unzip force system unzip command and zip-extension to force PHP Zip Extension and any other option will be silently ignored.

Some considerations:

  1. If we chose for zip-extension explicitly and the zip extension is not installed than an exception will be thrown, should it be handled?
  2. If we chose for system-unzip explicitly and the unzip command does not exists than an error will happen, should it be handled?
  3. Because the classes are very coupled with the new operator i was not able to test very well without very clumsy mock strategies, i just wrote a test to ensure that ti code is running fine and nothing is broken.

@paras-malhotra
Copy link
Member

Thanks @jleonardolemos, appreciate your contributions 👍 I'll try and get this in by the end of the week. Been busy with some stuff lately.

@paras-malhotra paras-malhotra added the enhancement New feature or request label May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unzip problems with v1.8.0+
2 participants