From 2e536ba1dc043568ef443f2177657e43527d35b1 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 29 May 2010 02:25:18 +0800 Subject: Display pkgdb info on package info page --- FedoraClient.php | 6 +++++- css/rpmphp.css | 1 + zoom.php | 38 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/FedoraClient.php b/FedoraClient.php index 516f54b..fe2d26c 100644 --- a/FedoraClient.php +++ b/FedoraClient.php @@ -35,7 +35,11 @@ abstract class FedoraClient { protected $cache; function __construct ($url, array $options) { - $this->cache = new Cache_Lite(array('memoryCaching'=>true, 'automaticSerialization'=>true)); + $dir = "/tmp/cachelite-".posix_getlogin()."/"; + @mkdir($dir); + $this->cache = new Cache_Lite(array('memoryCaching' => true, + 'cacheDir' => $dir, + 'automaticSerialization'=> true)); $this->url = $url; if (isset($options['agent']) && !empty($options['agent'])) { diff --git a/css/rpmphp.css b/css/rpmphp.css index 33e7f64..af1b8fc 100644 --- a/css/rpmphp.css +++ b/css/rpmphp.css @@ -148,6 +148,7 @@ p{ #list-packages td, #list-packages th{ + text-align: left; padding:.2em; background-color:white; } diff --git a/zoom.php b/zoom.php index f3c8bf8..09f37f4 100644 --- a/zoom.php +++ b/zoom.php @@ -1,6 +1,10 @@ $name not found\n"; } else { + echo "

Package: $name

\n"; + + if (isset($_GET['pkgdb'])) { + $fedpkg = $fedcli->getPackageInfo($name); + echo "

Hide pkgdb informations

"; + } else { + $fedpkg = false; + echo "

Show more informations from pkgdb

"; + } echo "\n"; echo "\n"; $i=0; @@ -69,6 +82,10 @@ if (!$name) { echo "\n"; } + if (isset($fedpkg['devel']['package']['description'])) { + echo "\n"; + } if ($rpm->url) { echo "\n"; @@ -109,15 +126,32 @@ if (!$name) { echo "
Upstream info
"; $i++; echo "Summary: ". $owner->summary . "
"; $i++; + echo "Description: ".$fedpkg['devel']['package']['description']."
"; $i++; echo "URL: ". $rpm->url . "
\n"; echo "\n"; + echo "\n"; $prev=false; do { + if ($rpm->repo_main=='rawhide' && isset($fedpkg['devel']['owner'])) { + $owner = $fedpkg['devel']['owner']; + $people = $fedpkg['devel']['people']; + } else if (isset($fedpkg[$rpm->repo_main]['owner'])) { + $owner = $fedpkg[$rpm->repo_main]['owner']; + $people = $fedpkg[$rpm->repo_main]['people']; + } else { + $owner =" "; + $people = false; + } + $comaint = ''; + if ($people) foreach ($people as $user) { + if (isset($user['aclOrder']['commit']['statuscode']) && $user['aclOrder']['commit']['statuscode']==3) { + $comaint .= $user['username']; + } + } echo ""; $i++; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; } while ($rpm = $resrpm->fetchObject()); - echo "
Packages available in Fedora Repositories
BranchRepositoryVersion-ReleaseOwnerCo-maintainers
".($rpm->repo_main==$prev ? " " : $prev=$rpm->repo_main)."".$rpm->repo_sub."".($rpm->epoch ? $rpm->epoch.":" : "").$rpm->ver."-".$rpm->rel."
$owner$comaint
"; + echo ""; } } catch(PDOException $e) { -- cgit