Skip to content
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

Use composer InstalledRepository to determine install dir #51

Merged
merged 5 commits into from
Apr 21, 2024

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Apr 20, 2024

based on composer/composer#11927 (comment) recommendation

Original $this->composer->getRepositoryManager() was wrong, as it searched all composer packages, not only the installed ones ignoring replace/provide composer options leading to possibly wrong path in theory.

I tested installing this installer in Roundcubemail (as composer root package) manually and all went right.

@mvorisek mvorisek marked this pull request as ready for review April 20, 2024 21:19
Comment on lines +24 to +28
$rootPackage = clone $this->composer->getPackage();
$installedRepo = new InstalledRepository([
$installedRepo,
new RootPackageRepository($rootPackage),
]);
Copy link
Contributor Author

@mvorisek mvorisek Apr 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: inspired by https://github.com/composer/composer/blob/2.7.3/src/Composer/Command/CheckPlatformReqsCommand.php#L77 which clones the root package, /wo clone, an exception is thrown

@mvorisek mvorisek force-pushed the honor_composer_replace branch 2 times, most recently from 9cea9e5 to 4d88b79 Compare April 20, 2024 23:15
@mvorisek mvorisek force-pushed the honor_composer_replace branch from 75ba177 to 8c74725 Compare April 20, 2024 23:18
@mvorisek mvorisek force-pushed the honor_composer_replace branch from fcb0f3d to d66380f Compare April 20, 2024 23:42
@mvorisek
Copy link
Contributor Author

@alecpl can this this PR me merged and tagged?

@alecpl alecpl merged commit 5916d6e into roundcube:master Apr 21, 2024
8 checks passed
@mvorisek mvorisek deleted the honor_composer_replace branch April 21, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants