summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-04-27 23:03:57 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-04-28 00:10:42 +0200
commite50f352643ec205822d9eadf3045a071ba078380 (patch)
tree472c123a76800004cb36a31d0a8b5d754d0827e4 /web/lib
parenteb6cf1fad0558d381dbd8af2483410eecd50d7c2 (diff)
downloadaur-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')
-rw-r--r--web/lib/aurjson.class.php7
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) {