You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,25 @@ This version supports Ampache 6.2.0 and newer.
14
14
*`api_format` selects `xml` or `json` responses
15
15
*`server_version` selects the api version to talk to, defaulting to 6
16
16
*`timeout` sets the per-request timeout in seconds
17
-
*`api_secure` selects `https` or `http`
18
17
19
18
### Changed (2.0.0)
20
19
21
20
*`send_command()` returns a `SimpleXMLElement` or a decoded json array as the server sent it, replacing the structure 1.x assembled
22
21
* Commands are checked against the api version in use, so a method that version does not serve is refused before the request is sent
23
22
*`tag`, `tags`, `tag_albums`, `tag_artists` and `tag_songs` are refused from API5 onwards, and `get_indexes`, `playlist_add_song` and `user_update` from API8, matching the versions that dropped them
23
+
*`api_secure` is consulted only when it is passed; otherwise the scheme on `server` selects `https` or `http`, and `https` remains the fallback when neither says
24
+
*`__construct()` requires a config array, where 1.x defaulted it to an empty one
25
+
*`debug_callback` receives `AmpacheApi\AmpacheApi/<version>` as its first argument in place of the bare `AmpacheApi` 1.x sent
26
+
27
+
### Removed (2.0.0)
28
+
29
+
* The public methods 1.x used to assemble its own response structure, made redundant by `send_command()` handing back the decoded response
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ Ampache API PHP Library.
4
4
5
5
## NEWS
6
6
7
-
Version 2 of this library is underway.
7
+
Version 2 is out, and it is not a drop-in replacement for 1.x.
8
8
9
-
There are major changes to help support multiple purposes as well as both XML and JSON responses.
10
-
11
-
The library will now return a SimpleXMLElement or a decoded JSON array instead of the frankenstein.
9
+
`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.
12
10
13
11
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.)
14
12
13
+
See the [CHANGELOG](CHANGELOG.md) for everything that moved.
14
+
15
15
## License
16
16
17
17
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.
@@ -25,11 +25,11 @@ When creating an AmpacheApi object config is set using a config array.
25
25
* Required
26
26
* username: string - Your API username
27
27
* password: string - Your API password, plain or already sha256 hashed
28
-
* server: string - Server address; an `http://` or `https://` prefix is stripped, and `api_secure` decides which is used
28
+
* server: string - Server address, with or without an `http://` or `https://` prefix
29
29
* Optional
30
30
* debug: bool - Enable debug mode which will echo debug messages (default: false)
31
31
* debug_callback: callable - Function that receives debug messages; it is called whether or not `debug` is on (default: null)
32
-
* api_secure: bool - Set to false to use http (default: true)
32
+
* api_secure: bool - Set to false to use http; when omitted, a scheme on `server` decides and https is the fallback
33
33
* api_format: string - Set API response format. xml, json (default: xml)
34
34
* server_version: int - Set API response version. 3, 4, 5, 6, 8 (default: 6)
35
35
* timeout: int - Per request timeout in seconds (default: PHP's `default_socket_timeout`)
0 commit comments