Composer PHP Package Manager
github.com
2
Leaving SiteNav
External Link Disclaimer
You are about to visit github.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Composer is a free and open-source application-level package manager for the PHP programming language, providing a standard format for managing dependencies of PHP software and required libraries. Created by Nils Adermann and Jordi Boggiano in 2012, Composer revolutionized PHP development by introducing modern dependency management to the PHP ecosystem, similar to npm for Node.js or Bundler for Ruby. Key features: dependency management: Composer resolves and installs project dependencies declared in a composer.json file. Dependencies are resolved semantically (e.g., 'symfony/console: ^6.0' means any 6.x version). Composer uses a SAT solver to resolve complex dependency trees, detecting and reporting conflicts. Packagist: the main repository (packagist.org) hosts over 400,000 packages. When a developer requires a package, Composer fetches it from Packagist (or a custom repository) and downloads it. composer.json: the project manifest in JSON format declaring dependencies (require, require-dev), autoload rules, scripts, and project metadata. composer.lock: a lock file that pins exact versions of all dependencies (including transitive dependencies), ensuring reproducible installs across environments. The lock file should be committed to version control. Autoloading: generates optimized autoloader files (vendor/autoload.php) supporting PSR-4, PSR-0, classmap, and files autoloaders. This eliminates the need for manual include/require statements. PSR-4 is the recommended standard. Scripts: custom callbacks executed before/after package installation, testing, or deployment. Global packages: install tools globally for system-wide CLI tools like PHP CS Fixer, PHPUnit, and Psalm. Plugins: extend Composer with custom installers, resolvers, and capabilities. Platform detection: automatically detects PHP version and extensions. Cross-platform (PHP). MIT.
Statistics
2
Views
0
Clicks
0
Like
0
Dislike