summaryrefslogtreecommitdiffstats
path: root/testpkgist.php
diff options
context:
space:
mode:
Diffstat (limited to 'testpkgist.php')
-rw-r--r--testpkgist.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/testpkgist.php b/testpkgist.php
new file mode 100644
index 0000000..ee9e418
--- /dev/null
+++ b/testpkgist.php
@@ -0,0 +1,17 @@
+<?php
+require "include/main.php";
+
+date_default_timezone_set('Europe/Paris');
+
+$db = new PDO ("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS);
+
+$pk = new PackagistClient();
+
+$pkg = new TablePackagist($db);
+foreach($pkg->request(array('ORDER'=>'rpmname')) as $rec) {
+ if ($rep = $pk->getPackage($rec['pkgname'])) {
+ printf("%-40s %-12s %-12s %s\n", $rep['name'], $rep['stable'], $rep['unstable'], $rep['state']);
+ }
+}
+
+var_dump($pk->getPackage('unkwnown/dontexists')); \ No newline at end of file