nadar/php-composer-reader
Small PHP library to read and manipulate composer.json. Load and validate readability/writability, dump full content, and work with typed section readers (e.g., require, autoload PSR-4) to iterate packages/namespaces, inspect constraints, and add sections.
composer.json data without file I/O, useful for:
composer.json arrays).composer.json structures are needed.composer CLI output (e.g., composer show) directly in PHP, bridging gaps between CLI tools and programmatic workflows.Look Here If:
composer.json manipulation (e.g., merging configs, dynamic generation) without file parsing.composer CLI output (e.g., extracting dependency trees, version info) in PHP.composer.json programmatically.Look Elsewhere If:
composer commands or Symfony’s Process component).node-composer or composer-json npm packages).webmozart/composer-merge-plugin if stability is critical.To Executives:
"This updated package now supports direct array manipulation of composer.json and parsing composer CLI output—enabling deeper automation for dependency management, security scans, and custom build tools. With PHP 8.3/8.4 support and recent contributions, it’s a low-risk, high-reward choice for internal tooling. Avoids vendor lock-in and reduces dev time compared to proprietary solutions."
To Engineering: *"The latest release adds two major features:
composer.json structures in-memory (e.g., for dynamic dependency generation or testing).composer command results (e.g., composer show) directly in PHP—no more shelling out to CLI tools.Use cases to prototype:
composer.json patches for dev dependencies.composer.json configs in unit tests.Let’s test it for [specific use case]—it’s a drop-in upgrade with zero breaking changes and modern PHP support."*
How can I help you explore Laravel packages today?