evilstudio/composer-parser
Composer 安装命令:
composer create-project evilstudio/composer-parser
包简介
Simple app for parse composer.json file from multiple repositories to one Excel spreadsheet
README 文档
README
Introduction
Composer Parser is a CLI tool for comparing Composer dependencies across multiple repositories.
It collects composer.json (optionally composer.lock), groups packages by configurable rules, and exports a consolidated report.
✨ Key Features
-
🔎 Multi-repository parsing- Reads dependency data from many repositories into one report.
-
🧠 Multiple parser modescomposerJsoncomposerJsonAndLockcomposerFull(includes latest versions viacomposer outdated)
-
🌐 Multiple providersgitRepositorygitlabApiFilesgitlabApiArchive
-
📤 Multiple output writersxlsxjsonhtmlgoogleSheets
-
🧩 Configurable grouping and styling- Regex-based package groups
- Version-based cell styling (used in XLSX and HTML)
📁 Project Structure
.
├── bin/ # CLI entrypoint
├── config/ # Parameters and service configuration
├── src/ # Application source code
│ ├── Api/ # Contracts
│ ├── Command/ # CLI commands
│ ├── Exception/ # Domain exceptions
│ ├── Model/ # Data models
│ └── Service/ # App use-cases, parsers, providers, writers, config/report/log services
├── tests/ # Unit and integration tests
└── var/ # Working data (repositories, results, logs)
🚀 Quick Start
1. Clone and install
git clone https://github.com/evilstudio/composer-parser.git
cd composer-parser
composer install
2. Prepare configuration
cp config/parameters.yaml.template config/parameters.yaml
Set at least:
app.config.providerTypeapp.config.parserTypeapp.config.writerType(xlsx,json,html,googleSheets)repository.config.repositoryListwriter.config.shared.sheetName(required)
3. Run parser
bin/console app:run
bin/console app:run -p config/parameters.custom.yaml #To use custom parameters file
4. Cleanup downloaded repositories
bin/console app:cleanup
bin/console app:cleanup -p config/parameters.custom.yaml #To use custom parameters file
💻 Commands
| Command | Description |
|---|---|
app:run |
Fetches data from configured repositories and writes report |
app:cleanup |
Removes downloaded repositories |
⚙️ Writer Configuration
Common local writer fields:
writer.config.local.fileNamewriter.config.local.fileDirectorywriter.config.shared.sheetName(required, used byxlsxandgoogleSheets)
Google Sheets writer (writerType: googleSheets) requires:
writer.config.googleSheets.spreadsheetIdwriter.config.googleSheets.serviceAccountJsonPath
🌐 Google Sheets Setup
- Create/open a Google Cloud project.
- Enable
Google Sheets APIin that project. - Create a Service Account and generate a JSON key.
- Share target spreadsheet with the Service Account email as
Editor. - Set in config:
app.config.writerType: googleSheetswriter.config.shared.sheetNamewriter.config.googleSheets.spreadsheetIdwriter.config.googleSheets.serviceAccountJsonPath
🧭 Notes
- Output file path is built from
writer.config.local.fileDirectory+fileName. {date}infileNameis replaced with current date (Y-m-d).- Errors are logged to
var/log/error.log. composerFullrequirescomposeravailable in PATH.gitRepositoryprovider requires localgit.xlsxoutput requires PHP extensionsext-zipandext-gd.
🧪 Testing
# Run all tests
./vendor/bin/phpunit --testdox
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-02