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

Source for file packages_orphan_patches.php

Documentation is available at packages_orphan_patches.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.    | Authors: Helgi Þormar Þorbjörnsson <helgi@php.net>                   |
  17.    +----------------------------------------------------------------------+
  18.    $Id: patches_on_open_reports.php 281637 2009-06-04 08:51:45Z clockwerx $
  19. */
  20.  
  21. include_once 'HTML/Table.php';
  22.  
  23. // Sortable tables http://www.kryogenix.org/code/browser/sorttable/
  24. $extra_header '<script type="text/javascript" src="/javascript/sorttable.js"></script>';
  25.  
  26. response_header('Quality Assurance Initiative - Orphan Packages with Patches',
  27.     false$extra_header);
  28.  
  29. $sql "
  30. SELECT
  31.     packages.package_type,
  32.     packages.name,
  33.     bugdb.ts2,
  34.     bugdb.id AS bug_id
  35. FROM
  36.     packages
  37.     JOIN bugdb ON packages.name = bugdb.package_name AND bugdb.status IN ('Open', 'Assigned', 'Analyzed', 'Critical', 'Verified')
  38.     JOIN bugdb_patchtracker ON bugdb.id = bugdb_patchtracker.bugdb_id
  39. WHERE
  40.     unmaintained = 1 AND package_type = 'pear' AND approved = 1
  41.   AND
  42.     (packages.newchannel IS NULL OR packages.newchannel = '')
  43.   AND
  44.     (packages.newpackagename IS NULL OR packages.newpackagename = '')
  45. GROUP BY
  46.     packages.id, packages.name, bugdb.package_name, bugdb.id
  47. ORDER BY
  48.     packages.name";
  49.  
  50. $res        $dbh->getAll($sqlnullDB_FETCHMODE_ASSOC);
  51. $total_rows $dbh->getOne('SELECT FOUND_ROWS()');
  52.  
  53. echo '<h1>Orphan packages with patches</h1>';
  54. echo 'Found ' $total_rows ' reports with patches attached<br /><br />';
  55.  
  56. $bugs = array('pear' => array());
  57. foreach ($res as $data{
  58.     $bugs[$data['package_type']][$data['name']]['bug_id'][]     $data['bug_id'];
  59. }
  60.  
  61. // PEAR
  62. $table = new HTML_Table(array('class' => 'sortable'));
  63. $table->setHeaderContents(00'Package');
  64. $table->setHeaderContents(01'# bugs');
  65.  
  66.  
  67. $row = 1;
  68. foreach ($bugs['pear'as $name => $qa{
  69.     $table->addRow(array(
  70.         make_link('/package/' $name '/'$name),
  71.         make_link('#package_bugs_' $namecount($qa['bug_id'])),
  72.     ));
  73.     $table->setCellAttributes($row1'style="text-align: center;"');
  74.     $row++;
  75. }
  76.  
  77. echo '<h2 id="pear">PEAR (' count($bugs['pear']')</h2>';
  78. echo $table->toHTML();
  79.  
  80. echo '<h2>Details</h2>';
  81. foreach ($bugs['pear'as $name => $qa{
  82.     echo '<h3 id="package_bugs_' $name '">' $name '</h3>';
  83.     echo '<ul>';
  84.     foreach ($qa['bug_id'as $bug_id{
  85.         echo '<li>' . make_link('/bugs/' $bug_id$bug_id'</li>';
  86.     }
  87.     echo '</ul>';
  88. }
  89.  
  90. response_footer();

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