-
Notifications
You must be signed in to change notification settings - Fork 186
Revert https://github.com/bigcommerce/bigcommerce-api-php/pull/155 #174
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
I'm... not sure if this is the correct way to fix this. It needs some more investigation I think. |
This isn't a straight revert though; you're adding new behaviour for every request by changing the flag after the connection is closed (which tbh I don't understand anyway). I'm also confused why the tests would pass on the original PR, I guess we don't have the flag to treat warnings as errors? |
@@ -91,6 +91,9 @@ class Connection | |||
*/ | |||
public function __construct() | |||
{ | |||
if (!defined('STDIN')) { | |||
define('STDIN', fopen('php://stdin', 'r')); | |||
} | |||
$this->curl = curl_init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PascalZajac I can remove this change to make this PR a proper revert.
I was hoping to resolve the issue(s) reported in #139
@PascalZajac the tests were not passing on the original PR. The regression wasn't caught by our basic tests then because we updated the bigcommerce-api-php repo but did not push/bump a new version in bcapp. |
The thing to keep in mind here is that this is the public API and its test suite was passing. We use this in functional testing but our first priority should be to stabilize it for the public use. |
I understand now, thank you for clarifing @bc-ruth. In that case, I'm happy for us to accept Ruth's PR, since it does seem to be the "accepted" way to define the constant when not running in CLI mode. |
@Lewiscowles1986 can you pull this branch and verify that this fixes your issue in #155 ? |
Hi all. I'm not encountering any breakage in test suites; would it be possible to let me know what is wrong? I've read, but I'm not sure I get it. I've just run
here is the output
Need to know if I have actually broken something or if what you mean is this breaks a third-party system somewhere down the line (i.e. it's a deck of cards where some third-party internal tools require this to work) |
Thanks @Lewiscowles1986 The original issue is described in #139 We tried to fix the issue above by removing a line in Connection.php (#155) So we would like to revert #155 but also need to fix the original issue in #139 another way, a fix that would work for both public and internal use. |
I've not tested @bc-ruth code in any live projects but it seems to fulfil all needs; I just downloaded and all tests pass (there did seem to be less tests and assertions) To be clear I don't think I ever had an issue with #139; I just noticed the issue and was put a bit out of joint by the advice to edit the API files directly (seemed like an easy PR) 😉 👍 for this to be merged. I Understand now |
…e away, resetting to default
@aleachjr @PascalZajac
What:
Reverting #155
and optionally define STDIN to address issues mentioned in same PR ^
Why:
Breaking basic tests
curl_exec(): CURLOPT_INFILE resource has gone away, resetting to default
FAILURES!
Tests: 70, Assertions: 476, Errors: 12.
Testing:
................................................................. 65 / 70 ( 92%)
.....
OK (70 tests, 541 assertions)