Download the PHP package ampache/php-discogs-api without Composer

On this page you can find all versions of the php package ampache/php-discogs-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-discogs-api

php-discogs-api (AmpacheDiscogs)

This library is a simple Discogs query library exported from the Ampache Discogs plugin.

The focus here is on keeping it small and simple.

All data is JSON decoded with objects converted into associative arrays.

License

AGPL-3.0-or-later. See LICENSE.md.

This library is an export of the Ampache Discogs plugin and carries Ampache's license. Releases before 0.3.0 declared MIT in composer.json; that was a mistake in the metadata, not a different license — the AGPL text and the source headers were there from the initial commit.

Requirements

Paging

Discogs paginates the list endpoints. Every method that hits one takes a trailing int $page = 1, and the pagination block in the response says how many pages there are:

Paged: get_artist_releases, get_label_releases, get_master_versions, get_collection_items_by_folder, get_user_lists, get_wantlist, search_album, search_artist, search_master, search_release. Pass a page to search() in its parameter array. Anything returning a single record takes no page.

Each request is paced to about a second, so walking a long list is not instant.

get_artist_releases() repeats a few records across page boundaries and returns 49 rows for a per_page of 50. That is Discogs, not this library: it happens on the raw endpoint under every sort option. Key on id when collecting pages from it:

The other paged endpoints — label releases, master versions, wantlists and search — return non-overlapping pages.

Rate limiting and errors

Discogs allows 60 authenticated requests a minute. The client paces itself to that, widens the gap as X-Discogs-Ratelimit-Remaining runs down, and retries a 429 or a 5xx up to three times, honouring Retry-After. Nothing is required of the caller for that to happen.

Anything that still fails throws AmpacheDiscogs\DiscogsException, which extends Exception and carries the HTTP status so the cases can be told apart:

Usage Example

Look in the /examples folder for more.

Testing

The unit suite never touches the network. The live suite is opt-in: copy .env.dist to .env and fill in a key and secret from https://www.discogs.com/settings/developers. Without them the live tests skip, so composer qa and CI stay green on a fresh checkout. .env is gitignored.

DISCOGS_TEST_USERNAME is optional and only gates the user endpoint tests. Environment variables take precedence over the file, so CI can supply the same names as secrets.


All versions of php-discogs-api with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
rmccue/requests Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ampache/php-discogs-api contains the following files

Loading the files please wait ...