定制 t4web/composer-lock-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

t4web/composer-lock-parser

最新稳定版本:1.2.0

Composer 安装命令:

composer require t4web/composer-lock-parser

包简介

OOP reader of composer.lock file.

README 文档

README

OOP reader of composer.lock file

Introduction

Parse composer.lock file and return full information about installed packages in OOP style.

Requirements

Features / Goals

  • Create Composer Entity with full general information from composer.lock [DONE]
  • Create Package Entity with full information about packges [DONE]

Installation

Main Setup

"require": {
    "t4web/composer-lock-parser": "1.1.*"
}

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 Codeception

$ codeception run

统计信息

  • 总下载量: 175.86k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 1
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 3
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-10-08