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

Source for file packages_closed_reports_no_release.php

Documentation is available at packages_closed_reports_no_release.php

  1. <?php
  2. /*
  3.    +----------------------------------------------------------------------+
  4.    | PEAR Web site version 1.0                                            |
  5.    +----------------------------------------------------------------------+
  6.    | Copyright (c) 2001-2008 The PHP Group                                |
  7.    +----------------------------------------------------------------------+
  8.    | This source file is subject to version 3.01 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/3_01.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.    +----------------------------------------------------------------------+
  17.    $Id$
  18. */
  19.  
  20. /*
  21.  * This page give you a list of all packages with closed bug report
  22.  * but hasn't had a release in X amount of time
  23.  */
  24. include_once 'HTML/Table.php';
  25.  
  26. // Sortable tables http://www.kryogenix.org/code/browser/sorttable/
  27. $extra_header '<script type="text/javascript" src="/javascript/sorttable.js"></script>';
  28.  
  29. response_header('Quality Assurance Initiative - Packages with closed reports but no release in the last 6 months',
  30.     false$extra_header);
  31.  
  32. // Just so we don't fetch bugs for packages that recently had a releases
  33. $min_release_date strtotime('-6 Months');
  34.  
  35. $sql "SELECT
  36.     packages.package_type,
  37.     packages.name,
  38.     bugdb.ts2,
  39.     bugdb.id AS bug_id,
  40.     UNIX_TIMESTAMP(r.releasedate) as releasedate,
  41.     unmaintained
  42. FROM
  43.     packages
  44.     JOIN bugdb ON packages.name = bugdb.package_name AND bugdb.status = 'Closed'
  45.     LEFT JOIN (
  46.         SELECT package, MAX(releasedate) as releasedate FROM releases GROUP BY package
  47.     ) as r ON packages.id = r.package
  48. WHERE";
  49.  
  50. // In case we want to show all packages, including the superseeded ones.
  51. if (!isset($_GET['showall'])) {
  52.     $sql .= "
  53.     (packages.newchannel IS NULL OR packages.newchannel = '')
  54.   AND
  55.     (packages.newpackagename IS NULL OR packages.newpackagename = '')
  56.   AND";
  57. }
  58.  
  59. $sql .= "
  60.     UNIX_TIMESTAMP(r.releasedate) < UNIX_TIMESTAMP(bugdb.ts2)
  61.   AND
  62.     UNIX_TIMESTAMP(r.releasedate) < $min_release_date
  63. GROUP BY
  64.     packages.id, packages.name, bugdb.package_name, bugdb.id, r.package
  65. ORDER BY
  66.     unmaintained DESC, r.releasedate";
  67.  
  68. $res        $dbh->getAll($sqlnullDB_FETCHMODE_ASSOC);
  69. $total_rows $dbh->getOne('SELECT FOUND_ROWS()');
  70.  
  71. echo 'Checks <a href="#pear">PEAR</a> and <a href="#pecl">PECL</a><br />';
  72. echo 'Found ' $total_rows ' reports that have been closed but their package has not had a release in 6 months<br /><br />';
  73.  
  74. $bugs = array('pear' => array()'pecl' => array());
  75. foreach ($res as $data{
  76.     $bugs[$data['package_type']][$data['name']]['bug_id'][]     $data['bug_id'];
  77.     $bugs[$data['package_type']][$data['name']]['last_release'$data['releasedate'];
  78.     $bugs[$data['package_type']][$data['name']]['unmaintained'$data['unmaintained'];
  79. }
  80.  
  81. // PEAR
  82. $table = new HTML_Table(array('class' => 'sortable'));
  83. $table->setHeaderContents(00'Package');
  84. $table->setHeaderContents(01'# bugs');
  85. $table->setHeaderContents(02'Last Release Date');
  86. $table->setHeaderContents(03"Unmaintained?");
  87.  
  88. $row = 1;
  89. foreach ($bugs['pear'as $name => $qa{
  90.     $table->addRow(array(
  91.         make_link('/package/' $name '/'$name),
  92.         make_link('/bugs/search.php?cmd=display&package_name[]=' $name '&status=CRSLR'count($qa['bug_id'])),
  93.         format_date($qa['last_release']),
  94.         $qa['unmaintained''Yes' ''
  95.     ));
  96.     $table->setCellAttributes($row1'style="text-align: center;"');
  97.     $table->setCellAttributes($row3'style="text-align: center;"');
  98.     $row++;
  99. }
  100.  
  101. echo '<h2 id="pear">PEAR (' count($bugs['pear']')</h2>';
  102. echo $table->toHTML();
  103.  
  104. response_footer();

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