diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-08 22:14:41 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-08 22:14:41 +0900 |
| commit | bfbb8bd5260dfffb2c1f7fc8935142b26a9c4039 (patch) | |
| tree | 556d8024f17d3b7ff60bc478575ba3f931d466f8 /crates/mozart-core/src/installer/mod.rs | |
| parent | d0d05f14a4d1b36f517077ffdaa4b335c812190f (diff) | |
| download | php-mozart-bfbb8bd5260dfffb2c1f7fc8935142b26a9c4039.tar.gz php-mozart-bfbb8bd5260dfffb2c1f7fc8935142b26a9c4039.tar.zst php-mozart-bfbb8bd5260dfffb2c1f7fc8935142b26a9c4039.zip | |
fix(check-platform-reqs): align with Composer's CheckPlatformReqsCommand flow
Mirror `CheckPlatformReqsCommand::execute` end-to-end: build an
`InstalledRepoLite` from lock/installed plus the root and the real
PlatformRepository, ksort the combined `$requires`, and run the
candidate matching loop with `findPackagesWithReplacersAndProviders`
so an installed package that `provide`s or `replace`s a platform name
(e.g. `symfony/polyfill-mbstring` providing `ext-mbstring`) is now
recognised as satisfying the requirement.
Fixes the JSON output schema to match Composer:
`failed_requirement` is the `{source, type, target, constraint}`
object (or null), `provider` is the bare "provided by …" string (or
null), and `status` is the unwrapped `success`/`failed`/`missing`.
Also switches `--format` to a clap `value_parser` and replaces the
"No installed packages found" hard error with Composer's warn-then-
proceed path so an empty lock yields `[]` and exit 0.
Adds `mozart_core::installer::InstalledCandidate` plus
`InstalledRepoLite::add_candidate` /
`find_with_replacers_and_providers` as the shared substrate for
future commands (`depends`, `prohibits`, `audit`) that need the same
provider/replacer index.
Diffstat (limited to 'crates/mozart-core/src/installer/mod.rs')
| -rw-r--r-- | crates/mozart-core/src/installer/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/mozart-core/src/installer/mod.rs b/crates/mozart-core/src/installer/mod.rs new file mode 100644 index 0000000..8572627 --- /dev/null +++ b/crates/mozart-core/src/installer/mod.rs @@ -0,0 +1,8 @@ +pub mod installed_repo; +pub mod suggested_packages_reporter; + +pub use installed_repo::{InstalledCandidate, InstalledRepoLite}; +pub use suggested_packages_reporter::{ + HasSuggests, MODE_BY_PACKAGE, MODE_BY_SUGGESTION, MODE_LIST, RootInfo, + SuggestedPackagesReporter, Suggestion, +}; |
