Skip to content

Jleagle/packagist-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Packagist API Client

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();

About

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

Resources

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages