cvs: pearweb /public_html/qa packages_orphan.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Sat, 22 Mar 2008 01:34:08 +0000 |
| Subject: | cvs: pearweb /public_html/qa packages_orphan.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-7360@lists.php.net to get a copy of this message | ||
dufuz Sat Mar 22 01:34:08 2008 UTC
Modified files:
/pearweb/public_html/qa packages_orphan.php
Log:
Request #12824 Better structure for the orphan QA page
Made the SQL query simpler, split the page into 2 sides, real orphans on one and supersded
packages on the other.
With supersded packages we point the package name to their channels frontpage
http://cvs.php.net/viewvc.cgi/pearweb/public_html/qa/packages_orphan.php?r1=1.6&r2=1.7&diff_format=u
Index: pearweb/public_html/qa/packages_orphan.php
diff -u pearweb/public_html/qa/packages_orphan.php:1.6
pearweb/public_html/qa/packages_orphan.php:1.7
--- pearweb/public_html/qa/packages_orphan.php:1.6 Sun Nov 26 14:50:02 2006
+++ pearweb/public_html/qa/packages_orphan.php Sat Mar 22 01:34:08 2008
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: Arnaud Limbourg <arnaud@limbourg.com> |
+----------------------------------------------------------------------+
- $Id: packages_orphan.php,v 1.6 2006/11/26 14:50:02 arnaud Exp $
+ $Id: packages_orphan.php,v 1.7 2008/03/22 01:34:08 dufuz Exp $
*/
/**
@@ -26,13 +26,11 @@
response_header('Quality Assurance Initiative - Orphan packages',
false);
-$query = "
- select p1.name as name1, p2.name as name2
- from packages p1
- left join packages p2 on p1.newpk_id=p2.id
- where p1.unmaintained=1 and p1.package_type = 'pear' and p1.approved = 1
- order by p1.name
-";
+$query = '
+ SELECT name, newpackagename, newchannel
+ FROM packages
+ WHERE unmaintained = 1 AND package_type = "pear" AND approved = 1
+ ORDER BY name';
$packages = $dbh->getAll($query, null, DB_FETCHMODE_ASSOC);
@@ -42,25 +40,43 @@
exit();
}
-echo "<h3>List of orphan packages</h3>\n";
-
-echo "<ul>\n";
+$superseded_packages = $orphan_packages = '';
foreach ($packages as $pck => $info) {
-
- $link = make_link('/package/' . $info['name1'],
- $info['name1'], '', 'title="' . $info['name1']
. '"');
+ $link = make_link('/package/' . $info['name'],
+ $info['name'], '', 'title="' . $info['name'] .
'"');
$link_superseding = '';
- if (!empty($info['name2'])) {
+ if (!empty($info['newpackagename'])) {
$link_superseding = 'There is a superseding package: ';
- $link_superseding .= make_link('/package/' . $info['name2'],
- $info['name2'], '', 'title="' . $info['name2']
. '"');
+ if ($info['newchannel'] != PEAR_CHANNELNAME) {
+ $host = 'http://' .
$info['newchannel'];
+ } else {
+ $host = '/package/' . $info['newpackagename'];
+ }
+ $link_superseding .= make_link($host, $info['newpackagename'], '',
+ 'title="' . $info['newpackagename']
. '"');
}
- echo '<li>' . $link . ' ' . $link_superseding .
"</li>\n";
+ if ($link_superseding !== '') {
+ $superseded_packages .= '<li>' . $link . ' ' . $link_superseding
. "</li>\n";
+ } else {
+ $orphan_packages .= '<li>' . $link . ' ' . $link_superseding .
"</li>\n";
+ }
}
+
+echo "<h2>List of orphan packages</h2>\n";
+
+echo '<table>';
+echo '<th>Orphaned Packages</th><th>Superseded Packages</th>';
+echo '<tr><td style="width: 50%; vertical-align: top;">';
+echo "<ul>\n";
+echo $orphan_packages;
+echo "</ul>\n";
+echo '</td><td style="width: 50%; vertical-align: top;">';
+echo "<ul>\n";
+echo $superseded_packages;
echo "</ul>\n";
+echo '</td></tr></table>';
-response_footer();
-?>
+response_footer();
\ No newline at end of file