[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-cvs
Subject:    [PEAR-CVS] =?utf-8?q?svn:_/pear/pearweb/tags/_pearweb=5Fqa-1.0.2/public=5Fhtml/qa/packages=5Fclosed=
From:       "=?utf-8?q?Daniel_O'Connor?=" <clockwerx () php ! net>
Date:       2011-04-26 6:22:53
Message-ID: svn-clockwerx-1303798973-310497-236020760 () svn ! php ! net
[Download RAW message or body]

clockwerx                                Tue, 26 Apr 2011 06:22:53 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=310497

Log:
Tagging the 1.0.2 release

Changed paths:
    A   pear/pearweb/tags/pearweb_qa-1.0.2/
    A   pear/pearweb/tags/pearweb_qa-1.0.2/public_html/
    A   pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/
    A + pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_closed_reports_no_release.php
        (from pear/pearweb/trunk/public_html/qa/packages_closed_reports_no_release.php:r310496)
    A + pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_orphan.php
        (from pear/pearweb/trunk/public_html/qa/packages_orphan.php:r310496)
    A + pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_orphan_patches.php
        (from pear/pearweb/trunk/public_html/qa/packages_orphan_patches.php:r310496)
    A + pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_status.php
        (from pear/pearweb/trunk/public_html/qa/packages_status.php:r310496)
    A + pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_status_detail.php
        (from pear/pearweb/trunk/public_html/qa/packages_status_detail.php:r310496)
    A + pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/patches_on_open_reports.php
        (from pear/pearweb/trunk/public_html/qa/patches_on_open_reports.php:r310496)


["svn-diffs-310497.txt" (text/x-diff)]

Copied: pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_closed_reports_no_release.php \
(from rev 310496, pear/pearweb/trunk/public_html/qa/packages_closed_reports_no_release.php)
 ===================================================================
--- pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_closed_reports_no_release.php	 \
                (rev 0)
+++ pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_closed_reports_no_release.php	2011-04-26 \
06:22:53 UTC (rev 310497) @@ -0,0 +1,121 @@
+<?php
+/*
+   +----------------------------------------------------------------------+
+   | PEAR Web site version 1.0                                            |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 2001-2008 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available at through the world-wide-web at                           |
+   | http://www.php.net/license/3_01.txt.                                 |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license@php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Helgi Þormar Þorbjörnsson <helgi@php.net>                   |
+   +----------------------------------------------------------------------+
+   $Id$
+*/
+
+/*
+ * This page give you a list of all packages with closed bug report
+ * but hasn't had a release in X amount of time
+ */
+include_once 'HTML/Table.php';
+
+// Sortable tables http://www.kryogenix.org/code/browser/sorttable/
+$extra_header = '<script type="text/javascript" \
src="/javascript/sorttable.js"></script>'; +
+response_header('Quality Assurance Initiative - Packages with closed reports but no \
release in the last 6 months', +    false, $extra_header);
+
+// Just so we don't fetch bugs for packages that recently had a releases
+$min_release_date = strtotime('-6 Months');
+
+$sql = "SELECT
+    packages.package_type,
+    packages.name,
+    bugdb.ts2,
+    bugdb.id AS bug_id,
+    UNIX_TIMESTAMP(r.releasedate) as releasedate
+FROM
+    packages
+    JOIN bugdb ON packages.name = bugdb.package_name AND bugdb.status = 'Closed'
+    LEFT JOIN (
+        SELECT package, MAX(releasedate) as releasedate FROM releases GROUP BY \
package +    ) as r ON packages.id = r.package
+WHERE";
+
+// In case we want to show all packages, including the superseeded ones.
+if (!isset($_GET['showall'])) {
+    $sql .= "
+    (packages.newchannel IS NULL OR packages.newchannel = '')
+  AND
+    (packages.newpackagename IS NULL OR packages.newpackagename = '')
+  AND";
+}
+
+$sql .= "
+    UNIX_TIMESTAMP(r.releasedate) < UNIX_TIMESTAMP(bugdb.ts2)
+  AND
+    UNIX_TIMESTAMP(r.releasedate) < $min_release_date
+GROUP BY
+    packages.id, packages.name, bugdb.package_name, bugdb.id, r.package
+ORDER BY
+    r.releasedate";
+
+$res        = $dbh->getAll($sql, null, DB_FETCHMODE_ASSOC);
+$total_rows = $dbh->getOne('SELECT FOUND_ROWS()');
+
+echo 'Checks <a href="#pear">PEAR</a> and <a href="#pecl">PECL</a><br />';
+echo 'Found ' . $total_rows . ' reports that have been closed but their package has \
not had a release in 6 months<br /><br />'; +
+$bugs = array('pear' => array(), 'pecl' => array());
+foreach ($res as $data) {
+    $bugs[$data['package_type']][$data['name']]['bug_id'][]     = $data['bug_id'];
+    $bugs[$data['package_type']][$data['name']]['last_release'] = \
$data['releasedate']; +}
+
+// PEAR
+$table = new HTML_Table(array('class' => 'sortable'));
+$table->setHeaderContents(0, 0, 'Package');
+$table->setHeaderContents(0, 1, '# bugs');
+$table->setHeaderContents(0, 2, 'Last Release Date');
+
+
+$row = 1;
+foreach ($bugs['pear'] as $name => $qa) {
+    $table->addRow(array(
+        make_link('/package/' . $name . '/', $name),
+        make_link('/bugs/search.php?cmd=display&package_name[]=' . $name . \
'&status=CRSLR', count($qa['bug_id'])), +        format_date($qa['last_release'])
+    ));
+    $table->setCellAttributes($row, 1, 'style="text-align: center;"');
+    $row++;
+}
+
+echo '<h2 id="pear">PEAR (' . count($bugs['pear']) . ')</h2>';
+echo $table->toHTML();
+
+// PECL
+$table = new HTML_Table(array('class' => 'sortable'));
+$table->setHeaderContents(0, 0, 'Package');
+$table->setHeaderContents(0, 1, '# bugs');
+$table->setHeaderContents(0, 2, 'Last Release Date');
+
+$row = 1;
+foreach ($bugs['pecl'] as $name => $qa) {
+    $table->addRow(array(
+        make_link('/package/' . $name . '/', $name),
+        count($qa['bug_id']),
+        format_date($qa['last_release'])
+    ));
+    $table->setCellAttributes($row, 1, 'style="text-align: center;"');
+    $row++;
+}
+
+echo '<h2 id="pecl">PECL (' . count($bugs['pecl']) . ')</h2>';
+echo $table->toHTML();
+
+response_footer();

Copied: pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_orphan.php (from \
rev 310496, pear/pearweb/trunk/public_html/qa/packages_orphan.php) \
                ===================================================================
--- pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_orphan.php	            \
                (rev 0)
+++ pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_orphan.php	2011-04-26 \
06:22:53 UTC (rev 310497) @@ -0,0 +1,82 @@
+<?php
+/*
+   +----------------------------------------------------------------------+
+   | PEAR Web site version 1.0                                            |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 2001-2005 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 2.02 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available at through the world-wide-web at                           |
+   | http://www.php.net/license/2_02.txt.                                 |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license@php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Arnaud Limbourg <arnaud@limbourg.com>                       |
+   +----------------------------------------------------------------------+
+   $Id$
+*/
+
+/**
+ * List orphan packages
+ */
+auth_require('pear.dev');
+
+response_header('Quality Assurance Initiative - Orphan packages',
+    false);
+
+$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);
+
+if (count($packages) == 0) {
+    echo '<p>There are no orphan packages</p>';
+    response_footer();
+    exit();
+}
+
+$superseded_packages = $orphan_packages = '';
+foreach ($packages as $pck => $info) {
+    $link = make_link('/package/' . $info['name'],
+        $info['name'], '', 'title="' . $info['name'] . '"');
+
+    $link_superseding = '';
+
+    if (!empty($info['newpackagename'])) {
+        $link_superseding = 'There is a superseding package: ';
+        if ($info['newchannel'] != PEAR_CHANNELNAME) {
+            $host = 'http://' . $info['newchannel'];
+        } else {
+            $host = '/package/' . $info['newpackagename'];
+        }
+        $link_superseding .= make_link($host, $info['newpackagename'], '',
+                                       'title="' . $info['newpackagename'] . '"');
+    }
+
+    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();
\ No newline at end of file

Copied: pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_orphan_patches.php \
(from rev 310496, pear/pearweb/trunk/public_html/qa/packages_orphan_patches.php) \
                ===================================================================
--- pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_orphan_patches.php	    \
                (rev 0)
+++ pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_orphan_patches.php	2011-04-26 \
06:22:53 UTC (rev 310497) @@ -0,0 +1,90 @@
+<?php
+/*
+   +----------------------------------------------------------------------+
+   | PEAR Web site version 1.0                                            |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 2001-2008 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available at through the world-wide-web at                           |
+   | http://www.php.net/license/3_01.txt.                                 |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license@php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Helgi Þormar Þorbjörnsson <helgi@php.net>                   |
+   +----------------------------------------------------------------------+
+   $Id: patches_on_open_reports.php 281637 2009-06-04 08:51:45Z clockwerx $
+*/
+
+include_once 'HTML/Table.php';
+
+// Sortable tables http://www.kryogenix.org/code/browser/sorttable/
+$extra_header = '<script type="text/javascript" \
src="/javascript/sorttable.js"></script>'; +
+response_header('Quality Assurance Initiative - Orphan Packages with Patches',
+    false, $extra_header);
+
+$sql = "
+SELECT
+    packages.package_type,
+    packages.name,
+    bugdb.ts2,
+    bugdb.id AS bug_id
+FROM
+    packages
+    JOIN bugdb ON packages.name = bugdb.package_name AND bugdb.status IN ('Open', \
'Assigned', 'Analyzed', 'Critical', 'Verified') +    JOIN bugdb_patchtracker ON \
bugdb.id = bugdb_patchtracker.bugdb_id +WHERE
+    unmaintained = 1 AND package_type = 'pear' AND approved = 1
+  AND
+    (packages.newchannel IS NULL OR packages.newchannel = '')
+  AND
+    (packages.newpackagename IS NULL OR packages.newpackagename = '')
+GROUP BY
+    packages.id, packages.name, bugdb.package_name, bugdb.id
+ORDER BY
+    packages.name";
+
+$res        = $dbh->getAll($sql, null, DB_FETCHMODE_ASSOC);
+$total_rows = $dbh->getOne('SELECT FOUND_ROWS()');
+
+echo '<h1>Orphan packages with patches</h1>';
+echo 'Found ' . $total_rows . ' reports with patches attached<br /><br />';
+
+$bugs = array('pear' => array());
+foreach ($res as $data) {
+    $bugs[$data['package_type']][$data['name']]['bug_id'][]     = $data['bug_id'];
+}
+
+// PEAR
+$table = new HTML_Table(array('class' => 'sortable'));
+$table->setHeaderContents(0, 0, 'Package');
+$table->setHeaderContents(0, 1, '# bugs');
+
+
+$row = 1;
+foreach ($bugs['pear'] as $name => $qa) {
+    $table->addRow(array(
+        make_link('/package/' . $name . '/', $name),
+        make_link('#package_bugs_' . $name, count($qa['bug_id'])),
+    ));
+    $table->setCellAttributes($row, 1, 'style="text-align: center;"');
+    $row++;
+}
+
+echo '<h2 id="pear">PEAR (' . count($bugs['pear']) . ')</h2>';
+echo $table->toHTML();
+
+echo '<h2>Details</h2>';
+foreach ($bugs['pear'] as $name => $qa) {
+    echo '<h3 id="package_bugs_' . $name . '">' . $name . '</h3>';
+    echo '<ul>';
+    foreach ($qa['bug_id'] as $bug_id) {
+        echo '<li>' . make_link('/bugs/' . $bug_id, $bug_id) . '</li>';
+    }
+    echo '</ul>';
+}
+
+response_footer();

Copied: pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_status.php (from \
rev 310496, pear/pearweb/trunk/public_html/qa/packages_status.php) \
                ===================================================================
--- pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_status.php	            \
                (rev 0)
+++ pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_status.php	2011-04-26 \
06:22:53 UTC (rev 310497) @@ -0,0 +1,44 @@
+<?php
+/*
+   +----------------------------------------------------------------------+
+   | PEAR Web site version 1.0                                            |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 2001-2005 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 2.02 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available at through the world-wide-web at                           |
+   | http://www.php.net/license/2_02.txt.                                 |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license@php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Arnaud Limbourg <arnaud@limbourg.com>                       |
+   +----------------------------------------------------------------------+
+   $Id$
+*/
+
+/**
+ * This page will show a list of packages with latest
+ * release information along with bug count and any other info
+ * that may be used to identify unmaintained packages
+ */
+auth_require('pear.qa');
+
+response_header('Quality Assurance Initiative - Packages status');
+
+$states = array('snapshot', 'devel', 'alpha', 'beta', 'stable');
+
+echo "View packages status for the following state\n";
+
+echo "<ul>\n";
+foreach ($states as $state) {
+    $link = make_link(
+    '/qa/packages_status_detail.php?state=' . $state,
+        'See packages status for state ' . $state, '',
+    'title="Details for state ' . $state . '"');
+    echo '<li>' . $link . '</li>';
+}
+echo "</ul>\n";
+
+response_footer();
\ No newline at end of file

Copied: pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_status_detail.php \
(from rev 310496, pear/pearweb/trunk/public_html/qa/packages_status_detail.php) \
                ===================================================================
--- pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_status_detail.php	     \
                (rev 0)
+++ pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/packages_status_detail.php	2011-04-26 \
06:22:53 UTC (rev 310497) @@ -0,0 +1,213 @@
+<?php
+/*
+   +----------------------------------------------------------------------+
+   | PEAR Web site version 1.0                                            |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 2001-2005 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 2.02 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available at through the world-wide-web at                           |
+   | http://www.php.net/license/2_02.txt.                                 |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license@php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Arnaud Limbourg <arnaud@limbourg.com>                       |
+   +----------------------------------------------------------------------+
+   $Id$
+*/
+
+/**
+ * This page will show a list of packages with latest
+ * release information along with bug count and any other info
+ * that may be used to identify unmaintained packages
+ */
+auth_require('pear.qa');
+
+require 'HTML/Table.php';
+extra_styles('/css/packages_status.css');
+
+// Sortable tables http://www.kryogenix.org/code/browser/sorttable/
+$extra_header = '<script type="text/javascript" \
src="/javascript/sorttable.js"></script>'; +$states = array('snapshot', 'devel', \
'alpha', 'beta', 'stable'); +
+response_header('Quality Assurance Initiative - Packages status',
+    false, $extra_header);
+
+$state = htmlspecialchars($_GET['state']);
+
+if (!in_array($state, $states)) {
+    report_error('This is not a valid state');
+    response_footer();
+    exit();
+}
+
+include_once 'pear-database-package.php';
+$pck = new package();
+
+$packages = $pck->listAll(false, false);
+if (PEAR::isError($packages)) {
+    report_error('Cannot list packages');
+    response_footer();
+    exit();
+}
+
+$total_packages_nbr = $studied_packages_nbr = 0;
+
+$tables = array();
+$time_scale = 15552000; // how much time elapsed since last release, in seconds
+
+$tables[$state]['old'] = new HTML_Table(
+    array(
+        'id'          => 'old',
+        'cellspacing' => 0,
+        'class'       => 'sortable'
+    )
+);
+$tables[$state]['old']->setCaption(
+    'Packages with state <em>'
+    . $state . '</em> which have not been released in '
+    . $time_scale / 86400 . ' days'
+);
+$tables[$state]['old']->setHeaderContents(0, 0, 'Package');
+$tables[$state]['old']->setHeaderContents(0, 1, 'Version');
+$tables[$state]['old']->setHeaderContents(0, 2, 'Date');
+$tables[$state]['old']->setHeaderContents(0, 3, '# bugs');
+
+$tables[$state]['new'] = new HTML_Table(
+    array(
+    'id'          => 'new',
+    'cellspacing' => 0,
+    'class'       => 'sortable'
+    )
+);
+$tables[$state]['new']->setCaption(
+    'Packages with state <em>'
+    . $state . '</em> with a release in the past '
+    . $time_scale / 86400 . ' days'
+);
+$tables[$state]['new']->setHeaderContents(0, 0, 'Package');
+$tables[$state]['new']->setHeaderContents(0, 1, 'Version');
+$tables[$state]['new']->setHeaderContents(0, 2, 'Date');
+$tables[$state]['new']->setHeaderContents(0, 3, '# bugs');
+
+foreach ($packages as $package => $pck_data) {
+    $total_packages_nbr++;
+
+    $latest_release = $pck->getRecent(1, $package);
+    if (PEAR::isError($latest_release) || count($latest_release) == 0) {
+        continue;
+    }
+
+    // we just want to see the packages for a given state
+    if ($latest_release[0]['state'] != $state) {
+        continue;
+    }
+
+    $release_date = strtotime($latest_release[0]['releasedate']);
+
+    $status = 'new';
+
+    if (time() - $time_scale > $release_date) {
+        $status = 'old';
+    }
+
+    $tables[$state][$status]->addRow(
+        array(
+            make_link('/package/' . $package,
+                $package, '', 'title="' . $package . '"'),
+            $latest_release[0]['version'],
+            date('Y-m-d', $release_date),
+            make_link("/bugs/search.php?cmd=display&package_name%5B%5D=" . \
urlencode($package), +            bugcount($package), '', 'title="Bugs for package ' \
. $package . '"') +        )
+    );
+
+    $studied_packages_nbr++;
+}
+
+$html = '';
+foreach ($tables as $state => $table) {
+    if ($table['old']->getRowCount() > 1) {
+        $html .= '<p class="old">' . $table['old']->toHtml() . '</p>';
+    }
+    if ($table['new']->getRowCount() > 1) {
+        $html .= '<p id="new">' . $table['new']->toHtml() . '</div>' . "\n";
+    }
+}
+
+$out = '
+<div id="container">
+    <p id="pageHeader">
+        <h1>Summary</h1>
+        <div id="subtitle">
+            <h2>Number of packages in PEAR: {{TOTAL_PACKAGES_NUMBER}}</h2>
+            <h2>Number of packages studied here : {{STUDIED_PACKAGES_NUMBER}}</h2>
+        </div>
+    </p>
+
+    <div id="details">
+        {{TABLES}}
+    </div>
+
+    <div id="footer">
+    Page last updated on: {{UPDATE_DATE}}
+    </div>
+</div>
+';
+
+$search = array(
+    '{{TOTAL_PACKAGES_NUMBER}}',
+    '{{STUDIED_PACKAGES_NUMBER}}',
+    '{{TABLES}}',
+    '{{UPDATE_DATE}}',
+);
+
+$replace = array(
+    $total_packages_nbr,
+    $studied_packages_nbr,
+    $html,
+    date('d F Y \a\t H:i:s')
+);
+
+$out = str_replace($search, $replace, $out);
+
+echo $out;
+
+response_footer();
+
+/**
+ * Count number of bugs for a package
+ *
+ * @string package name
+ * @return int number of bugs
+ */
+function bugcount($package)
+{
+    global $dbh;
+
+    $query = '
+        SELECT
+            COUNT(*)
+        FROM
+            bugdb
+        WHERE
+            package_name=' . $dbh->quoteSmart($package) . '
+            AND bug_type = "Bug"
+            AND status IN ("Open", "Critical", "Assigned", "Analyzed")
+            ';
+
+    $count = $dbh->getOne($query);
+
+    if (PEAR::isError($count)) {
+        return '0';
+    }
+
+    if ($count > 0 && $count < 10) {
+	    $count = "0$count";
+    }
+
+    return $count;
+}
+?>

Copied: pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/patches_on_open_reports.php \
(from rev 310496, pear/pearweb/trunk/public_html/qa/patches_on_open_reports.php) \
                ===================================================================
--- pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/patches_on_open_reports.php	    \
                (rev 0)
+++ pear/pearweb/tags/pearweb_qa-1.0.2/public_html/qa/patches_on_open_reports.php	2011-04-26 \
06:22:53 UTC (rev 310497) @@ -0,0 +1,88 @@
+<?php
+/*
+   +----------------------------------------------------------------------+
+   | PEAR Web site version 1.0                                            |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 2001-2008 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available at through the world-wide-web at                           |
+   | http://www.php.net/license/3_01.txt.                                 |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license@php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Helgi Þormar Þorbjörnsson <helgi@php.net>                   |
+   +----------------------------------------------------------------------+
+   $Id$
+*/
+
+include_once 'HTML/Table.php';
+
+// Sortable tables http://www.kryogenix.org/code/browser/sorttable/
+$extra_header = '<script type="text/javascript" \
src="/javascript/sorttable.js"></script>'; +
+response_header('Quality Assurance Initiative - Packages with patches on open \
reports', +    false, $extra_header);
+
+$sql = "
+SELECT
+    packages.package_type,
+    packages.name,
+    bugdb.ts2,
+    bugdb.id AS bug_id
+FROM
+    packages
+    JOIN bugdb ON packages.name = bugdb.package_name AND bugdb.status IN ('Open', \
'Assigned', 'Analyzed', 'Critical', 'Verified') +    JOIN bugdb_patchtracker ON \
bugdb.id = bugdb_patchtracker.bugdb_id +WHERE
+    (packages.newchannel IS NULL OR packages.newchannel = '')
+  AND
+    (packages.newpackagename IS NULL OR packages.newpackagename = '')
+GROUP BY
+    packages.id, packages.name, bugdb.package_name, bugdb.id
+ORDER BY
+    packages.name";
+
+$res        = $dbh->getAll($sql, null, DB_FETCHMODE_ASSOC);
+$total_rows = $dbh->getOne('SELECT FOUND_ROWS()');
+
+echo 'Checks <a href="#pear">PEAR</a> and <a href="#pecl">PECL</a><br />';
+echo 'Found ' . $total_rows . ' reports with patches attached<br /><br />';
+
+$bugs = array('pear' => array());
+foreach ($res as $data) {
+    $bugs[$data['package_type']][$data['name']]['bug_id'][]     = $data['bug_id'];
+}
+
+// PEAR
+$table = new HTML_Table(array('class' => 'sortable'));
+$table->setHeaderContents(0, 0, 'Package');
+$table->setHeaderContents(0, 1, '# bugs');
+
+
+$row = 1;
+foreach ($bugs['pear'] as $name => $qa) {
+    $table->addRow(array(
+        make_link('/package/' . $name . '/', $name),
+        make_link('#package_bugs_' . $name, count($qa['bug_id'])),
+    ));
+    $table->setCellAttributes($row, 1, 'style="text-align: center;"');
+    $row++;
+}
+
+echo '<h2 id="pear">PEAR (' . count($bugs['pear']) . ')</h2>';
+echo $table->toHTML();
+
+echo '<h2>Details</h2>';
+foreach ($bugs['pear'] as $name => $qa) {
+    echo '<h3 id="package_bugs_' . $name . '">' . $name . '</h3>';
+    echo '<ul>';
+    foreach ($qa['bug_id'] as $bug_id) {
+        echo '<li>' . make_link('/bugs/' . $bug_id, $bug_id) . '</li>';
+    }
+    echo '</ul>';
+}
+
+response_footer();



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic