jleagle/packagist-api-client

A small helper class to request package details from the Packagist API

1.1.0 2022-04-03 17:12 UTC

This package is auto-updated.

Last update: 2024-11-30 01:56:51 UTC


README

A small helper class to request package details from the Packagist API

Get a list of every package

$packagist = new Packagist();
$packages = $packagist->all();

This can return a lot of results and can be filtered like so:

$packagist = new Packagist();
$zend_packages = $packagist->all('*zend*');

This field supports multiple wildcards and character classes.

Search for a package

This will return the same paginated search results as on the Packagist website:

$packagist = new Packagist();
$zend_packages = $packagist->search('zend');

You can also filter the results by supplying an array of tags:

$packagist = new Packagist();
$zend_packages = $packagist->search('zend', ['zf2']);

The third parameter is the page number.

Get a packages details

$packagist = new Packagist();
$package = $packagist->package('jleagle', 'packagist-api-client');

Get the latest packages added

$packagist = new Packagist();
$package = $packagist->latestAdded();

Get the latest package releases

$packagist = new Packagist();
$package = $packagist->latestReleased();