diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-27 23:03:57 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-28 00:10:42 +0200 |
commit | e50f352643ec205822d9eadf3045a071ba078380 (patch) | |
tree | 472c123a76800004cb36a31d0a8b5d754d0827e4 /web/lib/aurjson.class.php | |
parent | eb6cf1fad0558d381dbd8af2483410eecd50d7c2 (diff) | |
download | aur-e50f352643ec205822d9eadf3045a071ba078380.tar.gz aur-e50f352643ec205822d9eadf3045a071ba078380.tar.xz |
Add a version tag to RPC replies
This is needed for clients to quickly differentiate between different
versions of the RPC API. The version number should be bumped whenever
there is a change that breaks backwards compatibility.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/aurjson.class.php')
-rw-r--r-- | web/lib/aurjson.class.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index ab8ebbc1..2e5e06de 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -115,7 +115,12 @@ class AurJSON { * @return mixed A json formatted result response. **/ private function json_results($type, $count, $data) { - return json_encode( array('type' => $type, 'resultcount' => $count, 'results' => $data) ); + return json_encode(array( + 'version' => 2, + 'type' => $type, + 'resultcount' => $count, + 'results' => $data + )); } private function get_extended_fields($pkgid) { |