evilstudio / composer-parser
Simple app for parse composer.json file from multiple repositories to one Excel spreadsheet
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
pkg:composer/evilstudio/composer-parser
Requires
- php: >=8.3
- ext-json: *
- ext-zip: *
- czproject/git-php: ^4.0
- daniel-ness/ansible-vault: ^0.0.3
- mikehaertl/php-shellcommand: ^1.6
- php-curl-class/php-curl-class: ^9.5
- phpoffice/phpspreadsheet: ^1.19
- symfony/config: ^6.3
- symfony/console: ^6.3
- symfony/dependency-injection: ^6.3
- symfony/expression-language: ^6.3
- symfony/filesystem: ^6.3
- symfony/yaml: ^6.3
README
β¨ Introduction
Composer Parser is a CLI tool for comparing dependencies across multiple repositories. It pulls composer.json (optionally composer.lock), groups packages by configurable rules, and generates a single XLSX report for easy comparison.
β Key Features
- Aggregates data from multiple repositories into one report.
- Supports three parser modes:
composerJson,composerJsonAndLock,composerFull. - Multiple data sources: local Git, GitLab API (files/zip archive).
- Configurable package groups and cell styling rules.
- XLSX output with comments for installed and latest versions.
π§© Requirements
- PHP >= 8.3
- PHP extensions:
ext-json,ext-zip - Git (only for
providerType: gitRepository) composerin PATH (required forparserType: composerFull)- GitLab Personal Access Token with
read_repository(for GitLab providers) - Ansible Vault password (optional, only for
gitlabApiArchive+auth.json.encrypted)
π οΈ Installation
- Clone the repository (recommended for easy updates):
git clone https://github.com/evilstudio/composer-parser.git cd composer-parser composer install - Install dependencies:
composer install
- Copy the configuration template:
cp config/parameters.yaml.template config/parameters.yaml
- Edit
config/parameters.yamlto configure the application. - Run the CLI commands (see the Commands section).
π Updating
git pull composer install
βοΈ Configuration (config/parameters.yaml)
All fields are documented in config/parameters.yaml.template. Copy it and fill in values.
π» Commands
| Command | Description |
|---|---|
app:run |
Fetches data from repositories and generates the XLSX report. |
app:cleanup |
Removes downloaded repositories from the working directory. |
π Output
- The XLSX file is written to
writer.config.local.fileDirectory. {date}in the filename is replaced with the current date (Y-m-d).- The sheet header includes a "Last update" timestamp.
- With
includeInstalledVersion=true, comments include versions fromcomposer.lock. - In
composerFull, a comment includes the latest version fromcomposer outdated.
π Project Structure
bin/ # CLI entry script
config/ # Configuration (parameters, services)
docker/ # Docker settings (xdebug)
src/ # Application source code
βββ Api/ # Interfaces
βββ Command/ # CLI commands
βββ Exception/ # Exceptions
βββ Model/ # Data models
βββ Service/ # Parsers, providers, writer
var/ # Working data (repositories, results)
vendor/ # Composer dependencies
π Documentation
- πΊοΈ Roadmap
- π§ Refactor Plan
π Notes
parserType: composerJsondoes not usecomposer.lock.parserType: composerJsonAndLockandcomposerFullexpect a validcomposer.lock.composerFullrunscomposer outdated --format=jsonin each repository directory.- The Dockerfile uses
php:8.3-cli; if you rely on Docker, keep it aligned with project requirements.