Install Foundation
Foundation requires PHP 8.3 or newer. Composer resolves the dependencies required by the aggregate package or selected components.
Install runtime components
Section titled “Install runtime components”Install the packages the application uses in production:
Add other components as the application needs them rather than installing integrations speculatively.
Install developer tooling separately
Section titled “Install developer tooling separately”The CLI package generates project code and normally does not belong in a production WordPress plugin archive:
Production builds can then exclude developer dependencies:
If generated code extends a runtime Foundation class, install that runtime package normally. For example, generated WP-CLI commands require stellarwp/foundation-wpcli in require.
Install every component
Section titled “Install every component”Install the aggregate package when one application intentionally owns the complete Foundation installation and expects to use most components:
This provides every runtime component and the developer CLI at vendor/bin/foundation. It is convenient for a complete application or development environment, but it is not the lean installation path for a distributable WordPress plugin.
Load Composer before Foundation
Section titled “Load Composer before Foundation”Load Composer’s generated autoloader from the application entrypoint before constructing the container or registering providers:
WordPress projects may use a build tool such as Strauss to prefix production dependencies. That packaging step does not change which Foundation packages belong in require or require-dev.
Continue
Section titled “Continue”Configure the container that providers and application services will share.