diff options
author | Remi Collet <fedora@famillecollet.com> | 2014-07-28 09:29:07 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2014-07-28 09:29:07 +0200 |
commit | 374feac70ef82d0c7324c2309b56493f8396f7c4 (patch) | |
tree | fb1d5d0be32ff6dc2d202861cabe46cc2fb32d86 /testpkgist.php | |
parent | 948ed2399a9e00c43ba4f34364ae466e85837277 (diff) |
add script to test pkgist
Diffstat (limited to 'testpkgist.php')
-rw-r--r-- | testpkgist.php | 17 |
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 |