Skip to content

check_parameters.php: Make the script's retval reflect errors #8790

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

Merged
merged 1 commit into from
Jun 16, 2022
Merged

check_parameters.php: Make the script's retval reflect errors #8790

merged 1 commit into from
Jun 16, 2022

Conversation

zippy2
Copy link
Contributor

@zippy2 zippy2 commented Jun 15, 2022

When the check_parameters.php script meets an error it prints it
out but the exit value is not affected, it's still 0. This does
not fly with projects that want to run this script as a part of
their test suite.

Therefore, make the script return 0 on success and 1 if any error
was reported.

Signed-off-by: Michal Privoznik [email protected]

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! It certainly makes sense to set an appropriate status code on failure.

I'm not sure, though, whether this script is still that useful. After all, it doesn't seem to check the "new" fast parameter parsing API, and as of PHP 8.0.0, there are additional run-time checks regarding parameters in debug builds.

@cmb69
Copy link
Member

cmb69 commented Jun 15, 2022

BTW, I just noticed that there is https://pecl.php.net/package/libvirt, but that never had a release. Maybe that'll change in the future. :)

@zippy2
Copy link
Contributor Author

zippy2 commented Jun 15, 2022

Yeah, I'm doing releases in the repository: https://gitlab.com/libvirt/libvirt-php/
If desired, I can learn how to propagate those into the site you linked (the maintainer listed there is the one who abandoned the project and I picked the project up after he left - so no knowledge was passed on really).

@cmb69
Copy link
Member

cmb69 commented Jun 15, 2022

If desired, I can learn how to propagate those into the site you linked

I think it would make sense to (also) release via PECL. The necessary steps are listed on https://pecl.php.net/account-request.php. :)

When the check_parameters.php script meets an error it prints it
out but the exit value is not affected, it's still 0. This does
not fly with projects that want to run this script as a part of
their test suite.

Therefore, make the script return 0 on success and 2 if any error
was reported.

Signed-off-by: Michal Privoznik <[email protected]>
@cmb69 cmb69 merged commit a87f4dd into php:master Jun 16, 2022
@cmb69
Copy link
Member

cmb69 commented Jun 16, 2022

Thanks again!

@zippy2 zippy2 deleted the check_parameters_retval branch June 17, 2022 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants