summaryrefslogtreecommitdiff
path: root/list.php
diff options
context:
space:
mode:
authorCamil Staps2017-02-07 14:08:22 +0100
committerCamil Staps2017-02-07 14:08:22 +0100
commit6c225f4d477bb55c367ffb48175fdb085e8128ef (patch)
tree01073c4b578cacb4c359b90d3516e60b0cd2b839 /list.php
parentInitial commit (diff)
Dockerise
Diffstat (limited to 'list.php')
-rw-r--r--list.php41
1 files changed, 0 insertions, 41 deletions
diff --git a/list.php b/list.php
deleted file mode 100644
index 24340a8..0000000
--- a/list.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-require_once('conf.php');
-
-$repo = [];
-
-$stmt = $db->prepare(
- 'SELECT `package`.`id`,`package`.`name`,`url`,`desc`,`author`.`name` ' .
- 'FROM `package`,`author` ' .
- 'WHERE `package`.`author_id` = `author`.`id`');
-$stmt->execute();
-$stmt->bind_result($id, $name, $url, $desc, $author);
-while ($stmt->fetch() === true) {
- $repo[] = [
- 'id' => $id,
- 'name' => $name,
- 'author' => $author,
- 'desc' => $desc,
- 'url' => $url,
- 'versions' => []
- ];
-}
-$stmt->close();
-
-$stmt = $db->prepare(
- 'SELECT `major`,`minor`,`revision`,`depends` ' .
- 'FROM `version` WHERE `package_id`=?');
-$stmt->bind_param('i', $pkg);
-$stmt->bind_result($maj, $min, $rev, $deps);
-for ($i = 0; $i < count($repo); $i++) {
- $pkg = $repo[$i]['id'];
- $stmt->execute();
- while ($stmt->fetch() === true) {
- $repo[$i]['versions'][] = [
- 'version' => [$maj, $min, $rev],
- 'depends' => json_decode($deps)
- ];
- }
- unset($repo[$i]['id']);
-}
-
-print(json_encode($repo));