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
Composer\InstalledVersions not found #532
Comments
Hi, I'm not certain:
|
|
This is the issue: for the scoped code you need to autoload the PHPScoper autoloader. It doesnt look clear from the doc in the "build without Box" section so it might be worth adding a note about it |
Just to be clear, I've actually tried using Box and encountered the same issue. I tried to pinpoint the issue by using Scoper without Box, which produced the same results. |
that is weird, but to keep in mind Box does more stuff so instead of trying to replicate what it does i would suggest to break down the issue as follows:
|
I've narrowed it down a bit, turns out that when I run the application that was produced using 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', If I use Box without scoper it works as expected. |
do you have a reproducer? I think there is more to it because both Box and PHP-Scoper build themselves in a similar fashion |
Wdym? A repo where this can be observed? |
Yes, something I could easily check out locally ideally |
here is a reproducer https://github.com/martinssipenko/php-scoper-issue |
thanks! will try to check it out during the week |
This now affects Psalm as well: vimeo/psalm#7329. @theofidry, did you have any luck looking into this? Even though we're using an outdated box version in Psalm, upgrading didn't change a thing as far as this issue is concerned. |
This should be fixed with 0.16. If that's not the case please open a new issue |
I'm trying to use scoper on my project where I use
Composer\InstalledVersions
class. After running scoper the class gets prefixed with_PhpScoper2d7049acc8b0
and becomes_PhpScoper2d7049acc8b0\Composer\InstalledVersions
. After running scoper I runcomposer dump --classmap-authoritative
from withinbuild/
directory.Now when I try to run my application I get an error:
Uncaught Error: Class '_PhpScoperb8eeadf8a1cd\Composer\InstalledVersions'
I've found that reference to this class is in
vendor/composer/autoload_classmap.php
file, but it's referencing a non-prefixed version:Is there anything I'm doing wrong?
The text was updated successfully, but these errors were encountered: