pearweb_qa
[ class tree: pearweb_qa ] [ index: pearweb_qa ] [ all elements ]

Source for file packages_orphan.php

Documentation is available at packages_orphan.php

  1. <?php
  2. /*
  3.    +----------------------------------------------------------------------+
  4.    | PEAR Web site version 1.0                                            |
  5.    +----------------------------------------------------------------------+
  6.    | Copyright (c) 2001-2005 The PHP Group                                |
  7.    +----------------------------------------------------------------------+
  8.    | This source file is subject to version 2.02 of the PHP license,      |
  9.    | that is bundled with this package in the file LICENSE, and is        |
  10.    | available at through the world-wide-web at                           |
  11.    | http://www.php.net/license/2_02.txt.                                 |
  12.    | If you did not receive a copy of the PHP license and are unable to   |
  13.    | obtain it through the world-wide-web, please send a note to          |
  14.    | license@php.net so we can mail you a copy immediately.               |
  15.    +----------------------------------------------------------------------+
  16.    | Authors: Arnaud Limbourg <arnaud@limbourg.com>                       |
  17.    +----------------------------------------------------------------------+
  18.    $Id$
  19. */
  20.  
  21. /**
  22.  * List orphan packages
  23.  */
  24.  
  25. response_header('Quality Assurance Initiative - Orphan packages',
  26.     false);
  27.  
  28. $query '
  29.     SELECT name, newpackagename, newchannel
  30.     FROM packages
  31.     WHERE unmaintained = 1 AND package_type = "pear" AND approved = 1
  32.     ORDER BY name';
  33.  
  34. $packages $dbh->getAll($querynullDB_FETCHMODE_ASSOC);
  35.  
  36. if (count($packages== 0{
  37.     echo '<p>There are no orphan packages</p>';
  38.     response_footer();
  39.     exit();
  40. }
  41.  
  42. $superseded_packages $orphan_packages '';
  43. foreach ($packages as $pck => $info{
  44.     $link = make_link('/package/' $info['name'],
  45.         $info['name']'''title="' $info['name''"');
  46.  
  47.     $link_superseding '';
  48.  
  49.     if (!empty($info['newpackagename'])) {
  50.         $link_superseding 'There is a superseding package: ';
  51.         if ($info['newchannel'!= PEAR_CHANNELNAME{
  52.             $host 'http://' $info['newchannel'];
  53.         else {
  54.             $host '/package/' $info['newpackagename'];
  55.         }
  56.         $link_superseding .= make_link($host$info['newpackagename']'',
  57.                                        'title="' $info['newpackagename''"');
  58.     }
  59.  
  60.     if ($link_superseding !== ''{
  61.         $superseded_packages .= '<li>' $link ' ' $link_superseding "</li>\n";
  62.     else {
  63.         $orphan_packages .= '<li>' $link ' ' $link_superseding "</li>\n";
  64.     }
  65. }
  66.  
  67. echo "<h2>List of orphan packages</h2>\n";
  68.  
  69. echo '<table>';
  70. echo '<th>Orphaned Packages</th><th>Superseded Packages</th>';
  71. echo '<tr><td style="width: 50%; vertical-align: top;">';
  72. echo "<ul>\n";
  73. echo $orphan_packages;
  74. echo "</ul>\n";
  75. echo '</td><td style="width: 50%; vertical-align: top;">';
  76. echo "<ul>\n";
  77. echo $superseded_packages;
  78. echo "</ul>\n";
  79. echo '</td></tr></table>';
  80.  
  81. response_footer();

Documentation generated on Mon, 11 Mar 2019 15:46:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.