Download the PHP package ampache/ampacheapi-php without Composer

On this page you can find all versions of the php package ampache/ampacheapi-php. 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 ampacheapi-php

ampacheapi-php

Ampache API PHP Library.

NEWS

Version 2 is out, and it is not a drop-in replacement for 1.x.

send_command() returns a SimpleXMLElement or a decoded JSON array exactly as the server sent it, instead of the structure 1.x assembled, so last_error() is now how you tell a successful call from a failed one.

This version of the library is supported from Ampache 6.2.0+ and talks to API versions 3, 4, 5, 6 and 8. (Ampache has no API 7.)

See the CHANGELOG for everything that moved.

License

Ampache API PHP Library is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License v3 (AGPLv3) as published by the Free Software Foundation.

Get Started

Initialize

When creating an AmpacheApi object config is set using a config array.

So as an example; this is how the Ampache server would initialize the library.

An unrecognised server_version falls back to 6 rather than leaving the client unable to send anything.

Handling errors

send_command() hands back whatever the server sent, decoded. An API error is a normal response carrying an error element, so check last_error() to find out whether the call worked.

last_error() returns null after a successful call, or an array of code, message, action, type and http. A type of transport means no readable answer arrived at all. API 8 reports errors with a real HTTP status where API 3 to 6 always answer 200, so http is 200 on the older versions.

Building a URL without sending it

get_command_url() signs a command the same way send_command() does but returns the URL, which is how you hand a stream or download link to a player.

Get server stats

Get all artists

Look in the /examples folder for more.


All versions of ampacheapi-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
ext-xml Version *
ext-json Version *
ext-simplexml Version *
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/ampacheapi-php contains the following files

Loading the files please wait ...