diff options
author | Remi Collet <fedora@famillecollet.com> | 2014-05-18 08:16:20 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2014-05-18 08:16:20 +0200 |
commit | e4e0499e2d9affd95f7bc06e6b65a46bdcb379bd (patch) | |
tree | 814e3470de5c38869a67deaa991154a3a2a81279 /testdb.php | |
parent | 0c3aa4390ff734a6cba4f04929493e19de285522 (diff) |
add packagist table for upstream monitoring
Diffstat (limited to 'testdb.php')
-rw-r--r-- | testdb.php | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -105,4 +105,32 @@ echo "PECL owner:"; print_r($acl->getOwners('php-pecl-%')); echo "PEAR channels:"; print_r($up->getChannels('pear')); -?> + +$pkg = new TablePackagist($db); +$nb = $pkg->getCount(); +echo "Pkgs number : $nb\n"; +if ($nb) { + $i=0; + foreach($pkg->request(array('ORDER'=>'rpmname')) as $rec) { + printf("%3d %-30s %s\n", $rec['id'], $rec['pkgname'], $rec['rpmname']); + if ($i++ > 10) { + echo ("...etc...\n"); + break; + } + } +/* +} else { + $f = '/home/rpmbuild/SPECS/remirepo/tools/checkpkgist/checkpkgist.json'; + $f = file_get_contents($f); + $pkgs = json_decode($f, true, 5, JSON_PARSER_NOTSTRICT); + foreach ($pkgs as $p => $q) { + $data = array( + 'pkgname' => $p, + 'rpmname' => $q, + ); + $pkg->add($data); + } + $nb = $pkg->getCount(); + echo "Pkgs number : $nb\n"; +*/ +} |