-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add proper handling of invalid script paths #26
Comments
So, it turns out the root cause is that php-fpm sends multiple packets in case the given script file does not exist and that those packets have different types. The first packet has the type Both packets are handled the same way and the internal socket status has an unintended transition from Furthermore the To fix these issues the A new The |
* Refers mainly to the error "Primary script unknown" resp. the response "File not found." * Adds new ProjectManagerException * Adds integration tests for network and unix domain socket
Implemented & successfully tested on PHP 7.1 - 7.3. Released with v2.5.0. |
Thank you. This makes work much easier. |
I've just opened #27 before realising I wasn't on the 2.5 version. This has actually caused us a recent problem whereby we execute PHP scripts which use Could this approach be made optional so, if we wish to silently monitor |
@andybee Somehow I knew this (your request) was coming, when I implemented the solution above. 😬 I already have a solution in mind that would:
In detail this could mean for a
$callback = function( string $outputBuffer, string $errorBuffer ) {};
Once this done users can decide whether to throw exceptions on error output in the response or not. I'd love to hear your (and maybe also @theseer 's) feedback regarding that approach. Before implementing it. I think discussion should take place in #27 which I re-opened. |
Going to reply in #27 then :) |
Expected Behavior
If an invalid script path is requested like in the following example, an exception is thrown.
Actual Behavior
The request is processed as it was successful with the response "File not found".
Specifications
Further comments
Check, if there is a specific state returned, but not handled in Socket.php Line 322 ff. or Socket.php Line 441 ff..
If there is no way to distinguish between a valid response with body "File not found" and one caused by an invalid script path, a guard method with path syntax check could be added to AbstractRequest.php
/cc @theseer
The text was updated successfully, but these errors were encountered: