jleagle / packagist-api-client
A small helper class to request package details from the Packagist API
Installs: 1 375
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=5.4.0
- jleagle/curl-wrapper: ~0.1
- vinelab/rss: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.3.0
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();