db export: Avoid exec() in option probe#326
Conversation
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
There was a problem hiding this comment.
Code Review
This pull request introduces a test case for database exports when PHP's exec() function is disabled and replaces direct exec() calls with a new command_supports_option method. Feedback suggests refactoring this new method to use WP_CLI\Process to mitigate potential deadlock risks and remove unnecessary STDIN usage.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
swissspidy
left a comment
There was a problem hiding this comment.
What a lovely surprise to see you here! Thanks for your contribution :)
|
Heya :) No problem, thanks for the quick merge! |
As described in #283, if the host disables the
exec()function,db exportwill fail silently with exit code 255.This works around that that by using
Utils\proc_open_compat().