summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-10-04 09:57:35 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-10-04 11:40:38 +0200
commit3c06716c729580f28c20d7b7522a3382ed857322 (patch)
treed365bedf4a48dc1c9dcc9ed39fa6ee22195b4706 /web
parent261c7f74dd17ad277fc9e1a1478983749578f133 (diff)
downloadaurweb-3c06716c729580f28c20d7b7522a3382ed857322.tar.xz
aurjson: Merge info and multiinfo commands
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web')
-rw-r--r--web/lib/aurjson.class.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index f4d5b3e..2bf2e7a 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -76,7 +76,7 @@ class AurJSON {
if (isset($http_data['v'])) {
$this->version = intval($http_data['v']);
}
- if ($this->version < 1 || $this->version > 4) {
+ if ($this->version < 1 || $this->version > 5) {
return $this->json_error('Invalid version specified.');
}
@@ -93,6 +93,9 @@ class AurJSON {
$this->dbh = DB::connect();
$type = str_replace('-', '_', $http_data['type']);
+ if ($type == 'info' && $this->version >= 5) {
+ $type = 'multiinfo';
+ }
$json = call_user_func(array(&$this, $type), $http_data);
$etag = md5($json);
@@ -250,7 +253,7 @@ class AurJSON {
} elseif ($this->version >= 2) {
if ($this->version == 2 || $this->version == 3) {
$fields = implode(',', self::$fields_v2);
- } else if ($this->version == 4) {
+ } else if ($this->version == 4 || $this->version == 5) {
$fields = implode(',', self::$fields_v4);
}
$query = "SELECT {$fields} " .