How composer/composer works
Composer is a PHP dependency manager: users declare project requirements, then Composer resolves packages, downloads them, installs them, and can generate an autoloader. Its repository, package, platform, and security-policy capabilities support that workflow; plugins and scripts extend command and lifecycle behavior. The map also includes repository search, archive creation, and advisory auditing. Evidence is limited to the README and indexed source references; where wiring was not shown, the graph omits the connection rather than assuming one.
Main entry points: Installer.php Install orchestration · Command Project commands · Application.php CLI application · Composer.php Runtime context
Components 22
CLI and project config
- CLI application
src/Composer/Console/Application.php - Project commands
src/Composer/Command - Project configuration
src/Composer/Config.php - Runtime context
src/Composer/Composer.php
Packages and resolution
- Package model
src/Composer/Package/Package.php - Version parsing
src/Composer/Package/Version/VersionParser.php - Platform packages
src/Composer/Repository/PlatformRepository.php - Dependency solver
src/Composer/DependencyResolver/Solver.php
Repositories and downloads
- Repository manager
src/Composer/Repository/RepositoryManager.php - Package metadata
src/Composer/Repository/ComposerRepository.php - VCS repositories
src/Composer/Repository/VcsRepository.php - Download manager
src/Composer/Downloader/DownloadManager.php - Package search
src/Composer/Command/SearchCommand.php
Install and extend
- Install orchestration
src/Composer/Installer.php - Installation manager
src/Composer/Installer/InstallationManager.php - Autoload generation
src/Composer/Autoload/AutoloadGenerator.php - Plugin manager
src/Composer/Plugin/PluginManager.php - Events and scripts
src/Composer/EventDispatcher/EventDispatcher.php
Security and archives
- Advisory auditing
src/Composer/Advisory/Auditor.php - Package archiving
src/Composer/Package/Archiver/ArchiveManager.php
Other components
- Project user
- Package registry
Connections 27
- Project user → CLI application: runs commands
README.md - Project user → Project configuration: declares requirements
README.md - CLI application → Install orchestration: runs install
src/Composer/Console/Application.php - CLI application → Runtime context: creates context
src/Composer/Console/Application.php - Project commands → CLI application: registers commands
src/Composer/Console/Application.php - Runtime context → Project configuration: uses configuration
src/Composer/Repository/ComposerRepository.php - Install orchestration → Repository manager: uses repositories
- Install orchestration → Dependency solver: resolves dependencies
src/Composer/Installer.php - Dependency solver → Package model: evaluates packages
- Dependency solver → Platform packages: checks platform
- Version parsing → Platform packages: parses constraints
src/Composer/Package/Version/VersionParser.php - Repository manager → Package metadata: creates repository
src/Composer/Repository/RepositoryManager.php - Repository manager → Runtime context: uses context
src/Composer/Repository/RepositoryManager.php - Package metadata → Package model: loads package data
src/Composer/Repository/ComposerRepository.php - Package metadata → Package registry: fetches metadata
- VCS repositories → Package model: loads package data
src/Composer/Repository/VcsRepository.php - Install orchestration → Download manager: downloads packages
src/Composer/Installer.php - Install orchestration → Installation manager: applies operations
src/Composer/Installer.php - Installation manager → Download manager: downloads files
src/Composer/Installer/InstallationManager.php - Install orchestration → Autoload generation: generates autoload
src/Composer/Installer.php - Runtime context → Plugin manager: holds manager
src/Composer/Plugin/PluginManager.php - Plugin manager → Events and scripts: subscribes handlers
src/Composer/Plugin/PluginManager.php - Project commands → Package search: includes search
src/Composer/Command/SearchCommand.php - Package search → Package registry: searches packages
- Project commands → Advisory auditing: includes audit
- Project commands → Package archiving: includes archive
- Package archiving → Download manager: uses downloads
src/Composer/Package/Archiver/ArchiveManager.php