-
Notifications
You must be signed in to change notification settings - Fork 6
Added a check to prevent non-CLI calls from failing. #9
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
Conversation
@mathroc I changed some stuff around. You can now explicitly ignore specific SAPIs when instantiating the |
awesome thank you ! it looks ready for me, let me know if it's ok to merge for you and I 'll do it and release a new version |
@mathroc I don't have anything left to do. So I'd be very happy if you could merge it in. |
that's fine with me, it's not fully tested on <=7.0 but those versions of php are not supported anymore anyway ( https://www.php.net/supported-versions.php ) and that's relatively straightforward so testing it on 7.1+ is most likely enough |
When using this package in a script that isn't called through the CLI, there is a big chance that the functions defined in the PCNTL package aren't available, because of obvious security implications.
Because of the fact that the
pcntl_signal
closure is set in the constructor of theRedisSimpleLock
, this class is unusable when used through different measure than the PHP CLI.This PR makes sure that the closure is only attached when the CLI is used.