composer/metadata-minifier
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The package "composer/metadata-minifier" is a compact utility library geared to handle metadata minification and expansion. Particularly, it is utilized in Composer's 2.x repository metadata protocol. The advantage of using this library lies in its capability to efficiently deal with large metadata, resulting in decreased loading times and improved overall performance of your PHP projects.
Utilizing composer/metadata-minifier is straightforward and easy with Composer. First, you need to ensure you have Composer installed. Once that is done, you need to install the "metadata-minifier" package using the following command:
$ composer require composer/metadata-minifier
The package provides two core functions: MetadataMinifier::expand()
and MetadataMinifier::minify()
. MetadataMinifier::expand()
is used to expand an array of minified versions back to their original format. On the other hand, MetadataMinifier::minify()
is used to minify an array of versions into a set of version differences. Here are examples of how to use these functions:
<?php
use Composer\MetadataMinifier\MetadataMinifier;
// Some versions to minify
$versions = ['1.0.0', '1.0.1', '1.1.0'];
// Minify versions
$minified = MetadataMinifier::minify($versions);
// Expand versions
$expanded = MetadataMinifier::expand($minified);
Note: PHP 5.3.2 is required to use this library, but using the latest version of PHP is highly recommended for optimal results.
As for the documentation of composer/metadata-minifier, it tends to be quite minimal or basic as visible from the GitHub page β https://github.com/composer/metadata-minifier. The requirements and basic usage are outlined in the README file found therein. For more in-depth understanding or for dealing with complex queries regarding usage, one may need to examine the source code or refer to the broader Composer documentation due to the close association of this package with Composer.