composer_installers/lib.rs
1//! Native reimplementations of the declarative Composer install plugins that
2//! PHP projects (Magento / Mage-OS especially) depend on. This crate never runs
3//! the PHP plugins or Composer scripts — it reproduces their declarative on-disk
4//! effect natively. Every input lives in `composer.json`, which is what makes a
5//! native port possible.
6//!
7//! - [`paths`] — `composer/installers`. A generic package-`type` → install-path
8//! router (e.g. `magento-theme` → `app/design/frontend/{$name}/`,
9//! `wordpress-plugin` → `wp-content/plugins/{$name}/`), with root
10//! `extra.installer-paths` overrides. Pure relocation; no copying.
11//!
12//! - [`deploy`] — `magento/magento-composer-installer`. A `magento2-component`
13//! package (canonically `magento/magento2-base`) declares an `extra.map` of
14//! `[source, dest]` pairs copied into the project root (this is how
15//! `index.php`, `pub/`, the `app/etc/*` skeleton land) plus an `extra.chmod`
16//! list of permission masks. Also generates `app/etc/vendor_path.php`, which
17//! Magento's bootstrap reads to locate `vendor/`.
18//!
19//! - [`laravel`] — Laravel's `post-autoload-dump` package discovery: writes the
20//! `bootstrap/cache/packages.php` manifest the framework would otherwise
21//! generate via `Illuminate\Foundation\ComposerScripts::postAutoloadDump`.
22
23pub mod deploy;
24pub mod laravel;
25pub mod paths;
26
27pub use deploy::{ChmodEntry, DeployPlan, DeployStats, VENDOR_PATH_PHP, apply_deploy, plan_deploy};
28pub use laravel::{
29 PACKAGES_CACHE, STALE_CACHES, blocking_post_autoload_dump, build_package_manifest,
30 clear_compiled, only_reproduced_scripts, render_packages_php,
31};
32pub use paths::{
33 InstallerPaths, install_path, install_path_relative_to_repo, unsupported_framework,
34};