summaryrefslogtreecommitdiffstats
path: root/testpkgist.php
blob: ee9e418633f44775fa61d87f966932cbc0d18aae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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'));