定制 composer/metadata-minifier 二次开发

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

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

composer/metadata-minifier

最新稳定版本:1.0.0

Composer 安装命令:

composer require composer/metadata-minifier

包简介

Small utility library that handles metadata minification and expansion.

README 文档

README

Small utility library that handles metadata minification and expansion.

This is used by Composer's 2.x repository metadata protocol.

Installation

Install the latest version with:

composer require composer/metadata-minifier

Requirements

  • PHP 5.3.2 is required but using the latest version of PHP is highly recommended.

Basic usage

Composer\MetadataMinifier\MetadataMinifier

  • MetadataMinifier::expand(): Expands an array of minified versions back to their original format
  • MetadataMinifier::minify(): Minifies an array of versions into a set of version diffs

For example to expand the dev versions (note the ~dev in the URL) of Monolog you would do:

$packageName = 'monolog/monolog';
$url = 'https://repo.packagist.org/p2/' . $packageName . '~dev.json';
$json = json_decode(file_get_contents($url), true);
$versions = \Composer\MetadataMinifier\MetadataMinifier::expand($json['packages'][$packageName]);

License

composer/metadata-minifier is licensed under the MIT License, see the LICENSE file for details.

统计信息

  • 总下载量: 108.27M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 182
  • 点击次数: 1
  • 依赖项目数: 13
  • 推荐数: 0

GitHub 信息

  • Stars: 180
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04