fr3nch13/composer-lock-parser
最新稳定版本:1.0.0
Composer 安装命令:
composer require fr3nch13/composer-lock-parser
包简介
OOP reader of composer.lock file.
README 文档
README
OOP reader of composer.lock file
This is a fork of the original project located at: https://github.com/t4web/ComposerLockParser
Introduction
Parse composer.lock file and return full information about installed packages in OOP style.
Requirements
PHP >= 7.4
TODO
- Add more info to the
Package.phpwith info from thecomposer.lock
Installation
composer.json:
"require": { "fr3nch13/composer-lock-parser": "~1.0" }
OR
composer require fr3nch13/composer-lock-parser
Usage
Creating ComposerInfo object and getting all of the packages
$composerInfo = new \ComposerLockParser\ComposerInfo('/path/to/composer.lock'); // default all packages $packages = $composerInfo->getPackages(); // or explicitly get all packages $packages = $composerInfo->getPackages($composerInfo::ALL); echo $packages[0]->getName(); echo $packages[0]->getVersion(); echo $packages[0]->getNamespace();
Getting just production packages.
$composerInfo = new \ComposerLockParser\ComposerInfo('/path/to/composer.lock'); $packages = $composerInfo->getPackages($composerInfo::PRODUCTION);
Getting just development packages.
$composerInfo = new \ComposerLockParser\ComposerInfo('/path/to/composer.lock'); $packages = $composerInfo->getPackages($composerInfo::DEVELOPMENT);
Testing
Tests runs with Phpunit, phpstan, and phpcs
I reccommend running composer ci before committing your code and pushing it to github.
See the scripts in composer.json.
$ composer ci
$ composer test
$ composer cs-check
$ composer phpstan
统计信息
- 总下载量: 2.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2023-02-27