-
Notifications
You must be signed in to change notification settings - Fork 49
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
Dependency nyholm/psr7 missing in 1.4.0 #105
Comments
Thank you for this issue. This library does NOT have a dependency on Nyholm/psr7, guzzlehttp/psr7 or any other client or PSR7 implementation. The only purpose of this library is to find the classes you have installed. So this library does: Could you give me some more details. What version of PHP are you running? Is Nyholm/psr7 installed in your application? |
@Nyholm No, Nyholm/psr7 is not installed in our application. The problem is for us 3 levels deep in dependencies.
The problems lie in the fact that, in our dependency tree, Nyholm/psr7 is never installed. This results in the following error in Magento2:
This error is in that sense 'correct', due to the fact that we don't have these source classes since it's nowhere required in the dependency tree. PS: we use PHP 7.0.26 ;-) |
Can you see where you are trying to use that class? Ie, what line generates the error? The error message is nothing that is printed here. |
@Nyholm well that's the problem right there, we do not use it anywhere. Furthermore, the only error shown is the one posted above, and the only place where it could have been thrown is in an underlying package (and my assumption is php-http/discovery, since its the only package using your code). |
Yes. But who is printing the error message or throwing an exception
It is only used if it is installed. That is why I cant figure out your errors with the details you describe.
I understand that you do not use it in production. But try research this problem locally. |
auto discovery does class_exists checks to see what implementation is available. could it be that your autoloader logs these errors? class_exists on non-existing classes is something that can happen and should not be an error. |
Took me a while, but here is the trace:
|
Looking at row 45 and forward. It seams like @dbu is correct. We run |
@Nyholm & @dbu see magento/magento2#14074 Thanks for looking anyways and I wish you guys the best of luck in the future ;-) |
I just cloned magento2 and ran:
Then I added the PHP file:
Running that PHP file will output "Class exists!". I forgot to register Magento's autoloaders |
Im closing this since an issue has been opened on Magento's repo. I also created a PR: magento/magento2#14085 |
This was a really strange attempt to circumvent a bug affecting end user in Magento :) Of course there is no need to add optional dependency as mandatory and there is nothing to fix in Magento core. From the stack trace the problem comes from |
It is clear to me that you do not understand the purpose of |
Lolwhat? :) How is that different from
? Of course I DO understand when particular library needs to be specified in |
Well clearly you dont, since |
lets not shout at each other - the analysis is done and @Nyholm provided a pull request to magento proving the bug is in the magento autoloader. there is nothing wrong with the discovery, it uses PHP as intended when it does a |
Actual Behavior
Due to the missing dependency, the sourcecode of nyholm/psr7 is never retrieved from packagist.org, resulting in the following bug:
[2018-03-07 15:33:57] main.ERROR: Source class "\Nyholm\Psr7\Factory\Stream" for "Nyholm\Psr7\Factory\StreamFactory" generation does not exist. [] []
Expected Behavior
No errors...
Steps to Reproduce
Possible Solutions
specify nyholm/psr7 in the require section of composer.json
The text was updated successfully, but these errors were encountered: