NOTE send_command() no longer normalises responses; it hands back what the server sent, so callers written against 1.x need updating.
This version supports Ampache 6.2.0 and newer.
- Support for API version 8, alongside 3, 4, 5 and 6
get_command_url()builds a signed command url without sending it, for handingstreamanddownloadurls straight to a playerlast_error()returns the api error from the lastsend_command()ascode,message,action,typeandhttp- Config options
api_formatselectsxmlorjsonresponsesserver_versionselects the api version to talk to, defaulting to 6timeoutsets the per-request timeout in seconds
send_command()returns aSimpleXMLElementor a decoded json array as the server sent it, replacing the structure 1.x assembled- Commands are checked against the api version in use, so a method that version does not serve is refused before the request is sent
tag,tags,tag_albums,tag_artistsandtag_songsare refused from API5 onwards, andget_indexes,playlist_add_songanduser_updatefrom API8, matching the versions that dropped themapi_secureis consulted only when it is passed; otherwise the scheme onserverselectshttpsorhttp, andhttpsremains the fallback when neither says__construct()requires a config array, where 1.x defaulted it to an empty onedebug_callbackreceivesAmpacheApi\AmpacheApi/<version>as its first argument in place of the bareAmpacheApi1.x sent
- The public methods 1.x used to assemble its own response structure, made redundant by
send_command()handing back the decoded responseparse_response()get_response()XML_create_parser()XML_cdata()XML_start_element()XML_end_element()
- Session tokens and handshake passphrases were written to
debug_callbackeven withdebugturned off - API8 errors and empty results were reported as no response at all, because they carry an http status where API3 to API6 answer 200
- A
pingmoved the session onto the server's default api version, so every later command was answered by a version the client never asked for - A server address whose scheme disagreed with
api_secureproduced an unusable url - Passing a non-scalar value as a command option raised a
TypeError - A
debug_callbackthat cannot be called is now reported when it is set, rather than failing on the first debug message - A missing
server,usernameorpasswordraised an undefined key warning before the configuration check ran
NOTE The 1.x releases shipped without notes, so the 1.x entries here were reconstructed from the git history after the fact.
This release carries no functional change, only a comment recording that the handshake hashes a password it may already have received hashed. The ambiguity it noted is resolved in 2.0.0, which detects a sha256 password rather than assuming one.
.php-cs-fixer.php, so the code style is enforced rather than described
- The handshake hashes the password before combining it with the timestamp, sending
sha256(timestamp . sha256(password)), so a plain password is what callers pass configure()reaches theREADYstate on ausernameand aserver; the password is no longer part of that checkconnect()returnstrueon a successful handshake, where it previously returned nothing at all
- Attributes arriving on a child element that had already been read as text replaced the first character of that text, turning
Some TitleintoAome Titlealongside an illegal offset warning
- Relicensed from GPLv2 to AGPLv3
- The class could not be autoloaded, because PSR-4 looks for
AmpacheApi.phpand the file was namedAmpacheApi.lib.php - Every
throwraised a "class not found" fatal in place of the exception it meant to report, because an unqualifiedExceptionresolves inside the namespace the 1.0.0 packaging introduced
First packaged release, extracted from Ampache's own tree.
composer.json, installable asampache/ampacheapi-phpwith PSR-4 autoloading fromsrc/and a PHP 5.4 floor- The
AmpacheApinamespace user,users,shoutsandtimelineare read as parent elements, so each one starts its own result entry instead of being folded into the element before it