summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-04-21 17:51:58 +0200
committerRemi Collet <fedora@famillecollet.com>2016-04-21 17:51:58 +0200
commit93d434191102e9b5eccdedb3828359ec7a67b207 (patch)
tree2048cc6ba6e050e841091c2cbd130f1f4cd9c098
parent1be373d489817ff91e077c97ac91779ebc1c8e22 (diff)
various rpms can provide the same packagist name
-rw-r--r--class/TablePackagist.php2
-rw-r--r--get.php6
2 files changed, 7 insertions, 1 deletions
diff --git a/class/TablePackagist.php b/class/TablePackagist.php
index 74cc9ea..4dd25bf 100644
--- a/class/TablePackagist.php
+++ b/class/TablePackagist.php
@@ -49,7 +49,7 @@ class TablePackagist extends CommonTable
`pkgname` varchar(100) NOT NULL,
`rpmname` varchar(200) NOT NULL,
PRIMARY KEY (`id`),
- UNIQUE KEY `pkgname` (`pkgname`),
+ KEY `pkgname` (`pkgname`),
UNIQUE KEY `rpmname` (`rpmname`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$this->exec($sql);
diff --git a/get.php b/get.php
index afcde43..e14845a 100644
--- a/get.php
+++ b/get.php
@@ -54,6 +54,12 @@ try {
$result[$rec['pkgname']] = $rec['rpmname'];
}
break;
+ case 'packagist2':
+ $pkgist = new TablePackagist($db);
+ foreach($pkgist->request(array('ORDER'=>'rpmname')) as $rec) {
+ $result[$rec['rpmname']] = $rec['pkgname'];
+ }
+ break;
default:
die("Invalid arg");
}