Composer
Technical details of the Composer installation phase.
Use
APPNETOS_COMPOSER_NO_DEV
and other supported Composer configuration settings according to the deployment policy.
The Composer installation phase is responsible for installing all Composer dependencies required by APPNETOS applications.
Unlike many PHP projects, Composer is not executed once for the entire workspace.
Instead, every APPNETOS application manages its own Composer dependencies independently.
Goals
The Composer installation phase has the following responsibilities:
- Discover all APPNETOS applications.
-
Detect applications containing a
composer.json. - Install Composer dependencies.
- Skip applications without Composer support.
- Produce deterministic installation results.
Application Discovery
The installer automatically scans the APPNETOS workspace for applications.
Every discovered application is evaluated independently.
Applications containing a
composer.json
are processed.
Applications without a
composer.json
are skipped.
No manual configuration is required.
Independent Dependencies
Each APPNETOS application owns its own dependency tree.
This provides several advantages:
- Independent application development.
- Independent application releases.
- Reduced dependency coupling.
- Easier customer-specific extensions.
- Cleaner separation between applications.
Applications therefore remain self-contained.
Root Repository
The APPNETOS root repository is not part of the application dependency system.
Its Composer configuration exists exclusively for development tooling.
Typical examples include:
- PHP CS Fixer
- Static analysis tools
- Development utilities
Application runtime dependencies are never installed into the root repository.
Installation Process
For every discovered application the installer performs the following steps.
- Verify that the directory represents a valid APPNETOS application.
-
Detect a
composer.json. - Execute Composer.
- Report success or failure.
- Continue with the next application.
Applications without Composer dependencies are skipped automatically.
Git Integration
Before executing Composer the installer configures the required Git safe directory.
This prevents Git ownership warnings inside Docker containers.
The configuration is performed only once and is fully idempotent.
Configuration
The Composer phase can be configured through environment variables.
Current configuration options include:
| Variable | Description |
|---|---|
APPNETOS_COMPOSER_COMMAND
|
Composer executable |
APPNETOS_COMPOSER_NO_DEV
|
Install without development packages |
APPNETOS_COMPOSER_PREFER_DIST
|
Prefer distribution archives |
APPNETOS_COMPOSER_OPTIMIZE_AUTOLOADER
|
Generate optimized autoloader |
APPNETOS_COMPOSER_NO_INTERACTION
|
Disable interactive prompts |
Error Handling
If Composer fails for an application, the installation process stops immediately.
This prevents partially installed environments.
The reported error always identifies the application that caused the failure.
Idempotency
The Composer installation phase is fully idempotent.
Running the installer repeatedly does not reinstall unchanged dependencies unnecessarily.
Composer itself determines whether package changes are required.
Summary
The Composer installation phase provides:
- Automatic application discovery
- Independent dependency management
- Automatic Git configuration
- Deterministic installations
- Fully repeatable execution
It forms the foundation for all subsequent installation phases.