1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//! Install a resolved `composer.lock` into a project — the install-from-lock
//! half of a Composer client, without running PHP.
//!
//! Given a `composer.json` + `composer.lock` and a project root, this crate
//! reproduces what `composer install` does to the filesystem:
//!
//! 1. verify the lock's content-hash (warn, never block, on drift);
//! 2. preflight the lockfile (reject unsupported dists and sources; warn about
//! Composer plugins and unrun `scripts`);
//! 3. diff against `vendor/composer/installed.json` to skip up-to-date
//! packages and sweep stale ones;
//! 4. download + verify + extract each changed dist in parallel into
//! `vendor/<vendor>/<package>/`;
//! 5. check out git-source packages (with a [`SourceFetcher`]) and
//! materialize `type: path` packages (symlink-or-copy);
//! 6. apply cweagans-style patches ([`composer_patches`]);
//! 7. run the declarative install plugins — the Magento deploy and Laravel
//! discovery ([`composer_installers`]);
//! 8. dump the autoloader ([`composer_autoload`]);
//! 9. link `vendor/bin` proxies.
//!
//! The **pubgrub solver is out of scope** — this consumes an already-resolved
//! lock. It is a sibling of [`composer_manifest`] (the lock model),
//! [`composer_installers`] (install-path routing + deploy + Laravel),
//! [`composer_autoload`] (`dump-autoload`), and [`composer_patches`].
//!
//! # Seams
//!
//! App-specific concerns are injected so the crate carries no
//! HTTP-client, progress-rendering, or paths policy of its own:
//!
//! - [`Fetcher`] — the single HTTP GET that populates the dist cache.
//! [`ReqwestFetcher`] is the batteries-included default (Composer User-Agent,
//! sha1 verify, atomic placement, bounded retry).
//! - [`Progress`] — per-package download/extract callbacks. [`NoProgress`] is
//! the silent default.
//! - `cache_root` (on [`InstallEnv`]) — where dist archives are cached.
//! - [`SourceFetcher`] — optional; installs packages locked to a git source.
//! [`GitSourceFetcher`] shells out to the system `git`.
//!
//! Root-script execution is opted in via [`ScriptHooks`]; pass `None` for the
//! deterministic scripts-off behavior.
//!
//! # Example
//!
//! ```no_run
//! use std::path::Path;
//! use composer_install::{InstallEnv, InstallOptions, NoProgress, ReqwestFetcher, install_from_lock};
//!
//! # fn main() -> eyre::Result<()> {
//! let fetcher = ReqwestFetcher::new()?;
//! let progress = NoProgress;
//! let env = InstallEnv::new(&fetcher, &progress, Path::new("/tmp/composer-dist-cache"));
//! let summary = install_from_lock(&env, Path::new("."), InstallOptions::default(), None)?;
//! println!("installed {} package(s)", summary.packages_installed);
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;